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

How to auto size column width in excel export of Jasperserver.


amrutaa

Recommended Posts

  • Replies 5
  • Created
  • Last Reply

Top Posters In This Topic

Top Posters In This Topic

Hi,

You can control the exporter as shown below,

JRXlsxExporter exporter = new JRXlsxExporter();
exporter.setExporterInput(new SimpleExporterInput(print));
ByteArrayOutputStream os = new ByteArrayOutputStream();
exporter.setExporterOutput(new SimpleOutputStreamExporterOutput(
os));
SimpleXlsxReportConfiguration config = new SimpleXlsxReportConfiguration();
config.setOnePagePerSheet(false);
config.setDetectCellType(true);
config.setIgnoreCellBackground(false);
config.setWrapText(true);
config.setRemoveEmptySpaceBetweenRows(true);
config.setCollapseRowSpan(true);
exporter.setConfiguration(config);
exporter.exportReport();
 
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...