protected InputStream exportToExcel(JasperPrint jp) throws Exception {
JRXlsExporter excelExporter = new JRXlsExporter();
ByteArrayOutputStream output = new ByteArrayOutputStream();
excelExporter.setParameter(JExcelApiExporterParameter.JASPER_PRINT, jp);
excelExporter.setParameter(JExcelApiExporterParameter.OUTPUT_STREAM, output);
excelExporter.exportReport();
return new ByteArrayInputStream(output.toByteArray());
}
protected InputStream exportToPDF(JasperPrint jp) throws Exception {
return new ByteArrayInputStream(JasperExportManager.exportReportToPdf(jp));