Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Jasper Reports Excel output

I need to generate a report in Excel format using Jasperreports. I am using iReports 3.7.0 The reports gets generated with no issues except the size of empty cells.

alt text

Can somebody please tell how to avoid the highlighted cell being enlarged. Also the normal cells are also a little larger than their content.

like image 701
Nayn Avatar asked Dec 10 '09 14:12

Nayn


1 Answers

Also,I would say stick to basics when you need to export Japser to XLS. I mean no graphics, and more.

The above solution is good for generating XLS from iReport.

If you would like to generate XLS thru program; use the following code

exporter = new JRXlsExporter();
exporter.setParameter(JRXlsExporterParameter.IS_COLLAPSE_ROW_SPAN, Boolean.TRUE);
exporter.setParameter(JRXlsExporterParameter.IS_REMOVE_EMPTY_SPACE_BETWEEN_COLUMNS, Boolean.TRUE);
exporter.setParameter(JRXlsExporterParameter.IS_REMOVE_EMPTY_SPACE_BETWEEN_ROWS, Boolean.TRUE);
exporter.setParameter(JRXlsExporterParameter.IS_ONE_PAGE_PER_SHEET, Boolean.FALSE);
exporter.setParameter(JRXlsExporterParameter.IS_DETECT_CELL_TYPE, Boolean.FALSE);
exporter.setParameter(JRXlsExporterParameter.IS_WHITE_PAGE_BACKGROUND, Boolean.FALSE);
exporter.setParameter(JRXlsExporterParameter.IS_IGNORE_GRAPHICS, Boolean.TRUE);
like image 178
Kalyan Avatar answered Oct 02 '22 00:10

Kalyan