exporter.setParameter(JRTextExporterParameter.PAGE_HEIGHT,new Integer(100));
exporter.setParameter(JRTextExporterParameter.PAGE_WIDTH,new Integer(100));
} else if (outputType.equalsIgnoreCase("pdf")) {
if(mimeType == null) mimeType = "application/pdf";
servletResponse.setContentType(mimeType);
if(exporter == null) exporter = new JRPdfExporter();
} else if (outputType.equalsIgnoreCase("JPG")) {
byte[] bytes = getImageBytes(report, jasperPrint);
if(mimeType == null) mimeType = "application/jpeg";
out.write(bytes);
return;
} else if (outputType.equalsIgnoreCase("JPGBASE64")) {
byte[] bytes = getImagesBase64Bytes(report, jasperPrint);
if(mimeType == null) mimeType = "text/plain";
out.write(bytes);
return;
} else {
if(mimeType != null && exporter != null) servletResponse.setContentType(mimeType);
else {
logger.warn("Impossible to load exporter for type " + outputType);
logger.warn("Pdf exporter will be used");
servletResponse.setContentType("application/pdf");
exporter = new JRPdfExporter();
}
}
logger.debug("MIME type of response is [" + servletResponse.getContentType()+ "]");
logger.debug("Exporter class used is [" + exporter.getClass().getName()+ "]");