Jump to content
Changes to the Jaspersoft community edition download ×

Print all reports to one sheet in excel export


Recommended Posts

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

  • Replies 0
  • Created
  • Last Reply

Top Posters In This Topic

Popular Days

Top Posters In This Topic

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 account

Sign in

Already have an account? Sign in here.

Sign In Now

  • Create New...