Java – How to remove empty column in excel report generated by JasperReports

export-to-excelireportjasper-reportsjava

I am using iReport to design JasperReports. Excel exported report is contains extra empty columns, I tried doing

<property name="net.sf.jasperreports.export.xls.remove.empty.space.between.columns" value="true"/> 

and

excelExporter.setParameter(JRXlsExporterParameter.IS_REMOVE_EMPTY_SPACE_BETWEEN_COLUMNS, Boolean.TRUE);

But the empty column is still getting displayed. Is there a way to remove this empty column from the report.

Best Answer

It depends on the exact report layout. That option is great when you have fields that are not adjoining. But with more complex layouts sometimes there are columns which are mostly blank.

The quickest solution is probably to layout the report better to avoid any space between fields.

Related Topic