Jump to content
Changes to the Jaspersoft community edition download ×

problem exporting report to excel


alexfe

Recommended Posts

Hi, i have the next problem:

I made my report with iReport, this one is simple and print 100 rows maybe more,  i want that my column header repeat in each page at the beginning, executing the report with iReport works, but when i do the same in my application the column header is not appers to the beginning,  my code is:

JasperPrint jasperPrint = JasperFillManager.fillReport(new FileInputStream(reportFile), parameters, conn);
                JRXlsExporter xlsExporter = new JRXlsExporter();
                xlsExporter.setParameter(JRExporterParameter.JASPER_PRINT, jasperPrint);
                xlsExporter.setParameter(JRExporterParameter.OUTPUT_FILE_NAME, outFileName);
                xlsExporter.setParameter(JRXlsExporterParameter.IS_DETECT_CELL_TYPE,Boolean.TRUE);
                xlsExporter.exportReport();

i' tried using page header instead, but it's not work.

Please anyone who can help me.

thanks.

Alex

Code:
JasperPrint jasperPrint = JasperFillManager.fillReport(new FileInputStream(reportFile), parameters, conn);                JRXlsExporter xlsExporter = new JRXlsExporter();                xlsExporter.setParameter(JRExporterParameter.JASPER_PRINT, jasperPrint);                xlsExporter.setParameter(JRExporterParameter.OUTPUT_FILE_NAME, outFileName);                xlsExporter.setParameter(JRXlsExporterParameter.IS_DETECT_CELL_TYPE,Boolean.TRUE);                xlsExporter.exportReport(); 
Link to comment
Share on other sites

  • Replies 4
  • Created
  • Last Reply

Top Posters In This Topic

Top Posters In This Topic

hi, tanks u for the answer, i tried but it does not work, i have the same problem, i try too with  PDF

 

JasperPrint jasperPrint = JasperFillManager.fillReport(new FileInputStream(reportFile), parameters, conn);
                JRPdfExporter exporter = new  JRPdfExporter();
                exporter.setParameter(JRExporterParameter.OUTPUT_FILE_NAME, outFileName);
                exporter.setParameter(JRExporterParameter.JASPER_PRINT,jasperPrint);
                exporter.exportReport();

In PDF format it's work, i don't know why the problem in excel, is the same jasper report,

 

Tanks again

 

Link to comment
Share on other sites

Hi, i tried with that library and it does not work.

The error is because in the first row each page, the height is not the same, in the first page, the row has a height 20, in the second page that height is de 40, same the next pages, how can i set height the first row of each page???.

 

Thans a lot.

Link to comment
Share on other sites

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...