-
-
Notifications
You must be signed in to change notification settings - Fork 1.4k
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
fix issue #436 skipped cell issue #437
Conversation
Test Case. The generated excel should have first and second empty cell. var workbook = new SXSSFWorkbook();
ISheet worksheet = workbook.CreateSheet("Sheet");
var maxRow = 1000;
for (int rownum = 0; rownum < maxRow; rownum++)
{
IRow row = ((SXSSFSheet) worksheet).CreateRow(rownum);
for (int celnum = 2; celnum < 34; celnum++)
{
ICell Cell = row.CreateCell(celnum);
Cell.SetCellValue("Cell: Row-" + rownum + ";CellNo:" + celnum);
}
}
FileStream sw = File.Open("test.xlsx", FileMode.Create);
workbook.Write(sw);
sw.Close(); |
Hey guys, when this will be available for use? I was having the issue as #436 using SXSSF |
Hi I am having the exact same issue but I am using XSSFWorkbook object and I am reading from the Excel (XLSX) file. Empty cells get skipped and the remaining cells shift towards the left. When I use HSSFWorkbook to read data from Excel (XLS) file that works perfectly fine. Please let me know whether this fix would also work when reading data from excel files and if yes when is this going to be released? Many Thanks, |
I'm also experiencing this issue when using SXSSF. My current use case requires me to use SXSSF due to large file requirements and out of memory exceptions. |
You could create every cell (including empty cell) when you writing for workaround. |
@canceriens would you mind to provide the sample code for reading / the sample xlsx file, and I could check if its covered by the fix . It's hard to image the test case for me, do you used row.GetEnumerator() ? But if you read cell by get cell, it shouldn't be a issue. Need more details to dig into this issue. |
@canceriens I don't think your issue is same as what fixed in this PR. You should use GetCell to get the cell object instead of iterating Cells. This is a common mistake for NPOI newbies. And I don't think this PR is a good place to discuss your issue since it's a bit misleading. |
Is this issue solved? I'm experiencing the same with NPOI 2.6.2. I managed to fix the first occurrence found but in the second occurrence, row 85 of attached excel file still get cell shifting in 'IRow row = sheet.GetRow(i);'. Following is a snippet of my code: ` if (xlsFile.Type == ".xlsx")
or even a hint/workaround on how to solve this. Thanks |
As title, this PR fixed #436 issue.