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

Excel finds a problem in the generated file if we use a font without setting its size #165

Closed
pYThMik opened this issue Jan 7, 2019 · 8 comments
Assignees
Labels
Milestone

Comments

@pYThMik
Copy link

pYThMik commented Jan 7, 2019

When generating a file with version 2.4.1, Excel now brings up this message (in french)

image

English message = same as https://github.com/tonyqus/npoi/issues/158

		private ICellStyle GetHeaderStyle()
		{
			var headerFont = Workbook.CreateFont();
			headerFont.Boldweight = (short)FontBoldWeight.Bold;
			var headerRowStyle = Workbook.CreateCellStyle();
			headerRowStyle.BorderBottom = BorderStyle.Thin;
			headerRowStyle.SetFont(headerFont);
			return headerRowStyle;
		}

If I use this style for my header cells, Excel bugs and all headers are repaired with font of size 1.
It was not the case with version 2.3.0.

I can solve the problem by adding this line :

headerFont.FontHeightInPoints = 11;

Suggestion:
Deprecate CreateFont() method and add a new method that requires a font size parameter.

@msvprogs
Copy link

msvprogs commented Feb 8, 2019

@pYThMik
Copy link
Author

pYThMik commented Feb 8, 2019

Well then this could easily be addressed. Thank you for having investigated.

@tonyqus
Copy link
Member

tonyqus commented Feb 8, 2019

This bug is valid. We will provide the fix in the next release

@tonyqus tonyqus self-assigned this Feb 8, 2019
@tonyqus tonyqus added the bug label Feb 8, 2019
@tonyqus tonyqus closed this as completed in 83d3a96 Feb 8, 2019
@superjulius
Copy link

Any idea when the next release will happen?

@Marshall-L-D
Copy link

Latest version on NuGet, 2.4.1, still has this issue. Took me several hours of debugging to track it down to this font size issue when creating a new font.

@matbest1
Copy link

matbest1 commented Sep 5, 2019

@tonyqus

Any idea when the next release will happen?

@patrikmor
Copy link
Contributor

Hello, fix was commited on Feb 8, 2019 but NuGet version 2.4.1 still has the bug.
When the NuGet will be updated?

@tonyqus tonyqus added this to the NPOI 2.5.0 milestone Mar 3, 2020
@tonyqus
Copy link
Member

tonyqus commented Jul 31, 2020

@patrikmor how about 2.5.1? Is it fixed?

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

7 participants