Jump to content
Changes to the Jaspersoft community edition download ×

"Shrink to fit" property when exporting to Excel


hozawa
Go to solution Solved by hozawa,

Recommended Posts

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

Link to comment
Share on other sites

  • Replies 1
  • Created
  • Last Reply

Top Posters In This Topic

Top Posters In This Topic

Posted Images

  • Solution

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.

stretchToFit_OK.png.bf085c45901f5ddf693864d05095bdf5.png

 

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×
×
  • Create New...