Jump to content
We've recently updated our Privacy Statement, available here ×

How to programmatically set auto fit properties for XlsxExporter?


marcos.guimaraes

Recommended Posts

I am trying to export my report to ".xlsx" format and I am facing problems with content that do not fit in the cell's width and height (the content gets cutted and I have to manually expand the cell height in order to visualize the complete content). I'm guessing  that something like 'autofit' would produce the automatic adjustment in cell's width and height but I'm not sure about how to apply these properties on my report. I would like to do something like what I am already doing for other desired properties (plese assume that "jasperPrint" and "output" are valid JasperPrint and OutputStream instances):

 

JRXlsxExporter exporterXLS = new JRXlsxExporter();
exporterXLS.setParameter(JRXlsExporterParameter.JASPER_PRINT, jasperPrint);
exporterXLS.setParameter(JRXlsExporterParameter.OUTPUT_STREAM, output);
exporterXLS.setParameter(JRXlsExporterParameter.IS_ONE_PAGE_PER_SHEET, Boolean.TRUE);
exporterXLS.setParameter(JRXlsExporterParameter.IS_DETECT_CELL_TYPE, Boolean.TRUE);
exporterXLS.setParameter(JRXlsExporterParameter.IS_REMOVE_EMPTY_SPACE_BETWEEN_ROWS, Boolean.FALSE);

 

Thanks in advance!

Link to comment
Share on other sites

  • Replies 0
  • Created
  • Last Reply

Top Posters In This Topic

Popular Days

Top Posters In This Topic

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...