aliabdullah.magna Posted October 25, 2018 Share Posted October 25, 2018 Hi everyone,I'm using Jasper with spring to export a set of separated reports to an excel file via a list of JasperPrint using the following code: public File getExcelFile() throws IOException, JRException{ File excel = new File(getReportTitle()+".xlsx"); JRXlsxExporter exporter = new JRXlsxExporter(); exporter.setExporterInput(SimpleExporterInput.getInstance(jasperPrintList)); // where jasperPrintList is a List<JasperPrint> of separated reports. exporter.setExporterOutput(new SimpleOutputStreamExporterOutput(excel)); SimpleXlsxReportConfiguration reportConfig = new SimpleXlsxReportConfiguration(); reportConfig.setOnePagePerSheet(false); reportConfig.setWrapText(true); reportConfig.setAutoFitPageHeight(true); exporter.setConfiguration(reportConfig); exporter.exportReport(); return excel; }[/code]Above code generates excel file with one sheet per report.How can I set it to generate all reports to one sheet only, not sheet per report?Thanks in advance. Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now