I'm using JRPptxExporter exporter = new JRPptxExporter(); to print pptx report but i'm having issue with font size its printing so small, please help me out. Here is my generate report function:
public String generateReportPPT(String name, Map params, String userName, String reportName) {
Connection conn = null;
InputStream stream = null;
try {
String placetime = "";
javax.naming.Context ctx = new javax.naming.InitialContext();
DataSource ds = (DataSource) ctx.lookup(
ApplicationBean1.getJNDIDataSource());
conn = ds.getConnection();
ExternalContext econtext = getExternalContext();
stream = econtext.getResourceAsStream(PREFIX + name + SUFFIX); //name
if (stream == null) {
throw new IllegalArgumentException("Unknown report name '" + name + "' requested");
}
JasperPrint jasperPrint = null;
placetime = name + "_" + userName + "_" + System.currentTimeMillis();
try {
jasperPrint = JasperFillManager.fillReport(stream, params, conn);
} catch (Exception ex) {
throw new FacesException(ex);
} finally {
if (conn != null) {
try {
conn.close();
} catch (Exception ex) {
log("Error Closing connection ", ex);
throw new FacesException(ex);
}
}
}
JRPptxExporter exporter = new JRPptxExporter();
HttpServletResponse response = (HttpServletResponse) econtext.getResponse();
exporter.setParameter(JRExporterParameter.JASPER_PRINT, jasperPrint);
exporter.setParameter(JRExporterParameter.OUTPUT_STREAM, response.getOutputStream());
exporter.setParameter(JRExporterParameter.OUTPUT_FILE_NAME, name + ".pptx");
response.setHeader("Content-Disposition", "attachment;filename=\"" + name + ".pptx" + "\"");
response.setContentType("application/vnd.openxmlformats-officedocument.presentationml.presentation");
exporter.exportReport();
return new String(placetime + ".pptx");
} catch (Exception ex) {
throw new FacesException(ex);
}
}