Jump to content

Last problem to solve and finish XLS/Excel report!


overday

Recommended Posts

After days working on it, my Excel Report is almost perfect (i.e. almost like I need it to be :P). However, there is one final problem I need to solve.

 

 

There is a zip file attached to this topic. There you'll find the xls file (my report), and the xml Jasper uses to generate the report.

 

 

[file name=excel_report.zip size=14322]http://www.jasperforge.org/components/com_joomlaboard/uploaded/files/excel_report.zip[/file]

 

 

Open the xls, please.

 

 

The problem is: Jasper is generating some empty rows (row 19 and row 36 in the attached file).

 

 

I know why it happens. If you click the "Print Preview" button, you'll see that thoses empty lines are there to fill the remaining space between the last result and the end of the printing area, in every page. I just don't know how to make Jasper to not generate those lines!

 

 

In the example xls, the row 19 should not exist (20 should be 19, 21 should be 20, and so on), as 36 should not exist too (37 should be 36, ...).

 

 

Is there a way to fix it? The xls report will not be used to printing, just to use excel funtions. If I want to print it, there's and option to generate it as PDF.

 

 

Here's the code I use to set Jasper parameters for the xls report:

 

 

Code:
JExcelApiExporter exporterXls = new JExcelApiExporter();

exporterXls.setParameter(JRExporterParameter.JASPER_PRINT, impressao);
exporterXls.setParameter(JRExporterParameter.OUTPUT_FILE_NAME,DIR_REPORTS + nomeArq);
exporterXls.setParameter(JExcelApiExporterParameter.IS_DETECT_CELL_TYPE,java.lang.Boolean.TRUE);
exporterXls.setParameter(JExcelApiExporterParameter.IS_ONE_PAGE_PER_SHEET, Boolean.FALSE);
exporterXls.setParameter(JExcelApiExporterParameter.IS_REMOVE_EMPTY_SPACE_BETWEEN_ROWS,Boolean.FALSE);
exporterXls.setParameter(JExcelApiExporterParameter.IS_WHITE_PAGE_BACKGROUND,Boolean.FALSE);
exporterXls.exportReport();

 

 

This is the last problem to finish my xls report, please, anybody help!

 

 

Thanks!

Link to comment
Share on other sites

  • Replies 1
  • 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...