Skip to content
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

NPOI Excel Merging Causing “Repaired Records” #158

Closed
DjMilenkovic opened this issue Dec 20, 2018 · 2 comments
Closed

NPOI Excel Merging Causing “Repaired Records” #158

DjMilenkovic opened this issue Dec 20, 2018 · 2 comments
Assignees
Labels
Milestone

Comments

@DjMilenkovic
Copy link

DjMilenkovic commented Dec 20, 2018

When I merge cells while creating EXCEL I always get error when I try to open file I get error from the picture.

image

When I click on Yes button, a file can be opened. Only last sheet remains without cells merging.
image

But when I create a file without cells merging, I don't get any error when I open it.

Here is my code for cells merging:

for (int s = 0; s < 40; s++)
{
    excelSheets[i].AutoSizeColumn(s);
    if (i >= 4 && i <= 8) 
    continue;
    var merge = new CellRangeAddress(0, 1, s, s);
    excelSheets[i].AddMergedRegion(merge);
}
@tonyqus
Copy link
Member

tonyqus commented Dec 22, 2018

which version of NPOI are you using? Btw, I don't suggest put AutoSizeColumn inside a loop. It will be potentially very slow.

@DjMilenkovic
Copy link
Author

I'm using 2.4.0 version inside ASP.NET Core. Thank you for advice

@tonyqus tonyqus added the bug label Jan 19, 2019
@tonyqus tonyqus self-assigned this Jan 19, 2019
tonyqus pushed a commit that referenced this issue Feb 8, 2019
This is a critical bug of FontHeight and will easily cause Excel file corruption. We will create a new release by the end of Feb.
@tonyqus tonyqus added this to the NPOI 2.5.2 milestone Jul 31, 2020
@tonyqus tonyqus closed this as completed Sep 12, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants