"Shrink to fit" property when exporting to Excel

0

Excel has a "Shrink to fit" property so font size is reduced when the content of a cell overflows. (see video http://www.youtube.com/watch?v=xg8zTH7MPrE)

Is there any option in JasperReports to set this Excel property when exporting to Excel?

 

I've asked Tibco Jaspersoft Support this and the told me to set the following properties. Settings these properties obviously won't shrink the font size but only increase the height of the cell to display the content.

- set net.sf.jasperreports.print.keep.full.text to true in your report
- set net.sf.jasperreports.export.xls.font.size.fix.enabled to true in your report
hozawa's picture
50868
Joined: Apr 24 2010 - 4:31pm
Last seen: 4 months 5 days ago

1 Answer:

0

I've looked at the source code and it seems there was an attempt to support "Shrink to Fit" but it has not yet be implemented.

However, shouldn't net.sf.jasperreports.export.xls.font.size.fix.enabled be set to "false" instead of "true" to enable font size to change dynamically?

Furthermore, the current net.sf.jasperreports.export.xls.font.size.fix.enabled is treated as a font property while Shrink to Fit is a cell property. Fixintg XlsxStyleHelper, XlsxSytleInfo, XlsxCellHelper, JRXlsxExporter, and JRXlsAbstractExporter fixed the problem.

 

hozawa's picture
50868
Joined: Apr 24 2010 - 4:31pm
Last seen: 4 months 5 days ago
Feedback
randomness