New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
ExcelWorksheet.Columns.AutoFit() is very slow #1316
Comments
If you run under Windows, EPPlus will measure the width of all the cells in the columns you autofit using System.Drawing.Commons If you have columns with many cell, a better approach might be to autofit on a subset of the columns cells. |
We will have another look at the performance in this method and see if we can improve it. |
I actually can't get the column autofit to work at all with any of the options listed here. Sample: |
After further investigation, I can see how this is happening. This action expands what EPPlus plus sees as the worksheet dimensions. To work around this, I changed my order of operations to:
Ideally, EPPlus would only AutoFit on columns that contain data, or set the worksheet dimensions to match the range that contains data. |
@ksowin - thanks for this input. We are planning to have another look at this function and see if we can improve the performance. |
With Excel, auto file of column widths takes a second or two. With the same worksheet, in EPPlus it takes ~10 minutes. Any idea why it takes so much longer in EPPlus since my understanding is both are doing the same operation?
The text was updated successfully, but these errors were encountered: