How to Make an excel autofit generated by jxl.jar

2019-05-19 04:12发布

I am using this code to make the excel.

exporterXLS = new JExcelApiExporter();
exporterXLS.setParameter(JRXlsExporterParameter.JASPER_PRINT, jasperPrint);
exporterXLS.setParameter(JRXlsExporterParameter.OUTPUT_FILE, file2);
exporterXLS.setParameter(JRXlsExporterParameter.IS_ONE_PAGE_PER_SHEET, Boolean.FALSE);
exporterXLS.setParameter(JRXlsExporterParameter.IS_DETECT_CELL_TYPE, Boolean.TRUE);
exporterXLS.setParameter(JRXlsExporterParameter.IS_WHITE_PAGE_BACKGROUND, Boolean.FALSE);
exporterXLS.setParameter(JRXlsExporterParameter.IS_REMOVE_EMPTY_SPACE_BETWEEN_ROWS, Boolean.TRUE);

I searched the whole api but didn't find any thing useable. Please help me out from this problem.

Any help appreciated.

1条回答
戒情不戒烟
2楼-- · 2019-05-19 04:26

There are these properties already:

net.sf.jasperreports.export.xls.auto.fit.column

And:

net.sf.jasperreports.export.xls.auto.fit.row

Their value must be set to true.

查看更多
登录 后发表回答