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

0

HI,

My report's data is not auto resized in excel export of jasper server. I don't want to wrap the data. Is there any property to auto increase the length of field in excel export?

 

amrutaa's picture
15
Joined: May 21 2015 - 11:25pm
Last seen: 3 years 10 months ago

 

 

amrutaa - 4 years 9 months ago

4 Answers:

0

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();
 
abc.hegde's picture
166
Joined: Apr 1 2015 - 4:02am
Last seen: 9 months 3 weeks ago
0

Hi,

Where do we need to set this exporter property in Jaspersoft studio?

amrutaa's picture
15
Joined: May 21 2015 - 11:25pm
Last seen: 3 years 10 months ago
0

Actually code posted above is for Exporting Excel using Jasper from Java. I am not sure about the Jasper studio. I use ireport designer and there i can set tthese options in - Tools - Options - Export Options- Excel

abc.hegde's picture
166
Joined: Apr 1 2015 - 4:02am
Last seen: 9 months 3 weeks ago
0

Click on the main report and go the advanced option and hit the propteries. This is the place where we can set properties while excel exporting in Jasper Server.

jo.jasmine's picture
Joined: Apr 6 2015 - 8:50am
Last seen: 1 year 3 months ago
Feedback