I am using ZuckerReports_1.14_module from SugarForge.
In order to export Excel2007(.xlsx) format, I did a little modification to implement this export format.
1) Open file "modules/ZuckerReportTemplate/ReportTemplate.php", and add IF statement in function execute():
2) Open file "modules/ZuckerReportTemplate/language/en_us.lang.php", here I only fix English language pack, add code in "REPORT_EXPORT_TYPES" array:PHP Code:if ($format == 'XLSX') {
$this->report_result_name = $date."_".$base.".xlsx";
}
3) Decompile zuckerreports-1.0.jar by JD-GUI, and add custom code "XLSX" in Java function:PHP Code:'XLSX' => 'Excel2007 (*.xlsx)',
For now I am using jasperreports-4.1.3.jar in java classpath, this jasper release improved Excel export performance.PHP Code:private static JRExporter getJRExporter() {
JRExporter result = null;
String format = getProperty("jasper.format");
if ((format == null) || (format.length() == 0) || (format.equalsIgnoreCase("PDF"))) {
result = new JRPdfExporter();
} else if (format.equalsIgnoreCase("XLS")) {
result = new JRXlsExporter();
} else if (format.equalsIgnoreCase("XLSX")) {
result = new JRXlsxExporter();
result.setParameter(JRXlsExporterParameter.IS_DETECT_CELL_TYPE, Boolean.TRUE);
result.setParameter(JRXlsExporterParameter.IS_FONT_SIZE_FIX_ENABLED, Boolean.TRUE);
result.setParameter(JRXlsExporterParameter.IS_REMOVE_EMPTY_SPACE_BETWEEN_ROWS, Boolean.TRUE);
result.setParameter(JRXlsExporterParameter.IS_REMOVE_EMPTY_SPACE_BETWEEN_COLUMNS, Boolean.TRUE);
} else if (format.equalsIgnoreCase("CSV")) {
...
}
4) Build your custom zuckerreport jar file and replace it in "modules/ZuckerReports/jasper/zuckerreports-1.0.jar".
5) Thank you ZuckerReports![]()


LinkBack URL
About LinkBacks




Reply With Quote

Bookmarks