Export pentaho report to Excel 2007 format (.xlsx)
This commit is contained in:
Vendored
+2
-2
@@ -9,8 +9,8 @@
|
|||||||
# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
|
# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
|
||||||
DEFAULT_JVM_OPTS="-Xdebug -Xrunjdwp:transport=dt_socket,address=8005,server=y,suspend=n"
|
DEFAULT_JVM_OPTS="-Xdebug -Xrunjdwp:transport=dt_socket,address=8005,server=y,suspend=n"
|
||||||
|
|
||||||
CATALINA_OPTS="-Xms512m -Xmx512m"
|
CATALINA_OPTS="-Xms512m -Xmx2048m"
|
||||||
JAVA_OPTS="-Xms512m -Xmx512m -XX:PermSize=256m -XX:MaxPermSize=512m"
|
JAVA_OPTS="-Xms512m -Xmx2048m -XX:PermSize=256m -XX:MaxPermSize=512m"
|
||||||
|
|
||||||
APP_NAME="Gradle"
|
APP_NAME="Gradle"
|
||||||
APP_BASE_NAME=`basename "$0"`
|
APP_BASE_NAME=`basename "$0"`
|
||||||
|
|||||||
+8
-2
@@ -248,7 +248,7 @@ public class ReadReportingServiceImpl implements ReadReportingService {
|
|||||||
outputType = outputTypeParam;
|
outputType = outputTypeParam;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!(outputType.equalsIgnoreCase("HTML") || outputType.equalsIgnoreCase("PDF") || outputType.equalsIgnoreCase("XLS") || outputType
|
if (!(outputType.equalsIgnoreCase("HTML") || outputType.equalsIgnoreCase("PDF") || outputType.equalsIgnoreCase("XLS") || outputType.equalsIgnoreCase("XLSX") || outputType
|
||||||
.equalsIgnoreCase("CSV"))) { throw new PlatformDataIntegrityException("error.msg.invalid.outputType",
|
.equalsIgnoreCase("CSV"))) { throw new PlatformDataIntegrityException("error.msg.invalid.outputType",
|
||||||
"No matching Output Type: " + outputType); }
|
"No matching Output Type: " + outputType); }
|
||||||
|
|
||||||
@@ -279,13 +279,19 @@ public class ReadReportingServiceImpl implements ReadReportingService {
|
|||||||
PdfReportUtil.createPDF(masterReport, baos);
|
PdfReportUtil.createPDF(masterReport, baos);
|
||||||
return Response.ok().entity(baos.toByteArray()).type("application/pdf").build();
|
return Response.ok().entity(baos.toByteArray()).type("application/pdf").build();
|
||||||
}
|
}
|
||||||
|
|
||||||
if ("XLS".equalsIgnoreCase(outputType)) {
|
if ("XLS".equalsIgnoreCase(outputType)) {
|
||||||
ExcelReportUtil.createXLS(masterReport, baos);
|
ExcelReportUtil.createXLS(masterReport, baos);
|
||||||
return Response.ok().entity(baos.toByteArray()).type("application/vnd.ms-excel")
|
return Response.ok().entity(baos.toByteArray()).type("application/vnd.ms-excel")
|
||||||
.header("Content-Disposition", "attachment;filename=" + reportName.replaceAll(" ", "") + ".xls").build();
|
.header("Content-Disposition", "attachment;filename=" + reportName.replaceAll(" ", "") + ".xls").build();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if ("XLSX".equalsIgnoreCase(outputType)) {
|
||||||
|
ExcelReportUtil.createXLSX(masterReport, baos);
|
||||||
|
return Response.ok().entity(baos.toByteArray()).type("application/vnd.openxmlformats-officedocument.spreadsheetml.sheet")
|
||||||
|
.header("Content-Disposition", "attachment;filename=" + reportName.replaceAll(" ", "") + ".xlsx").build();
|
||||||
|
}
|
||||||
|
|
||||||
if ("CSV".equalsIgnoreCase(outputType)) {
|
if ("CSV".equalsIgnoreCase(outputType)) {
|
||||||
CSVReportUtil.createCSV(masterReport, baos, "UTF-8");
|
CSVReportUtil.createCSV(masterReport, baos, "UTF-8");
|
||||||
return Response.ok().entity(baos.toByteArray()).type("text/csv")
|
return Response.ok().entity(baos.toByteArray()).type("text/csv")
|
||||||
|
|||||||
Reference in New Issue
Block a user