You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hi, I have code that works with XSSF and properly auto resizes columns. I moved on to SXSSFSheet to be able to handle bigger datasets and I can't make auto resize work.
I'm generating a sheet with 45 columns and around 250 rows. NuGet package 2.5.3. I do the following:
Create the sheet
Call TrackColumnForAutoSizing for all columns (or TrackAllColumns, doesn't matter)
Fill everything and set styles as needed (but the issue is independent from styles)
Call AutoSizeColumn on each column
The output is somehow auto sized, but it seems to only consider the last row or rows (maybe the window size). If I reorder the rows when I prepare the file, so that the widest values stays at the bottom, the columns are resized correctly.
I checked the code and I see that for SXSSFSheet the width is calculated as max between the width in the current window and the one from the already flushed rows.
I noticed that in commit 2df83be a call to _autoSizeColumnTracker.UpdateColumnWidths() was removed from SXSSFRow.flushOneRow(). In the same commit I can't see anything replacing that.
I'm looking at this source code for the first time so I might be wrong, but it seems to me that call was needed. I will try to compile and test but I'd like some comments to understand if I'm dead wrong.
The text was updated successfully, but these errors were encountered:
Hi, I have code that works with XSSF and properly auto resizes columns. I moved on to SXSSFSheet to be able to handle bigger datasets and I can't make auto resize work.
I'm generating a sheet with 45 columns and around 250 rows. NuGet package 2.5.3. I do the following:
The output is somehow auto sized, but it seems to only consider the last row or rows (maybe the window size). If I reorder the rows when I prepare the file, so that the widest values stays at the bottom, the columns are resized correctly.
I checked the code and I see that for SXSSFSheet the width is calculated as max between the width in the current window and the one from the already flushed rows.
I noticed that in commit 2df83be a call to _autoSizeColumnTracker.UpdateColumnWidths() was removed from SXSSFRow.flushOneRow(). In the same commit I can't see anything replacing that.
I'm looking at this source code for the first time so I might be wrong, but it seems to me that call was needed. I will try to compile and test but I'd like some comments to understand if I'm dead wrong.
The text was updated successfully, but these errors were encountered: