Exporting to Excel reduces font size

Has anyone else noticed this?  If so, how have you gotten around this bug?

For all my reports, I use a style sheet with defined styles.  All fonts I use are Tahoma.  Some are size 8 (row data), 10 (column headers), 14 (report titles).  You get the idea.

But when I publish any report to JS Server, and run the report and export the report to Excel, all the fonts are one size smaller than what I defined them as.

For instance, my row data in Excel is now Tahoma 7, my column headers Tahoma 9, and my report titles are Tahoma 13.

I did some experimenting, and if in Studio when I overwrote the row data style and defined the field as Tahoma 9, then when I run and export the report, that data field is displayed as Tahoma 8. 

I did further experimenting and didn't use a style sheet, and just created some text fields of size Tahoma 8, Tahoma 10, Tahoma 14, and Arial 14, SansSerif 10, and Calibri 8  When I ran and exported the report, they all were in Excel with one size smaller.  So it is not a style sheet issue nor a font issue.  The fonts are properly sized in Studio, Preview.

Why in JS Server would exporting to Excel reduce the font size by 1?  And more importantly, how can I fix this?

mwarner_2's picture
2030
Joined: Jul 10 2015 - 1:17pm
Last seen: 5 years 6 months ago

1 Answer:

It's probably because the following property is not set.

net.sf.jasperreports.export.xls.font.size.fix.enabled

hozawa's picture
162969
Joined: Apr 24 2010 - 4:31pm
Last seen: 3 years 7 months ago

Thank you.  Adding the following keeps the font size from getting reduced.  Who would have known?

<property name="net.sf.jasperreports.export.xls.font.size.fix.enabled" value="false"/>

mwarner_2 - 7 years 3 months ago

So you gotta *disable* the font size fix in order for font sizes to be fixed... This is just great.

christoph.hoeller - 6 years 10 months ago

this solution is not working in  Jasper Report 7.1.0 version 

vinothm2k - 4 years 3 weeks ago
Feedback
randomness