Removing page breaks in Excel export

Is there a way to remove page breaks when exporting to Excel other than by using the 'Ignore Pagination' property?  I have some lengthy reports that our CEO and clients want to be able to export to Excel and to sort to their liking once in Excel (ignoring the problem where JS creates multiple Excel cells in many columns, making sorting problematic, an issue I am still awaiting an answer for).  I know that setting 'Ignore Pagination' will remove the page breaks, but these reports are large enough so that setting that propery causes a 'Java heap space' error, so I'm stuck between the proverbial rock and hard place.  I can either run the report in a format that our CEO and users likely won't accept when exported to Excel, or just not produce the report.  Is there any answer for this?

drummer54's picture
361
Joined: Mar 17 2014 - 7:34am
Last seen: 6 years 11 months ago

3 Answers:

Your exporting as xls or xlsx and NOT paginated xls or xlsx right?

The allignment of the report depends upon your design, make sure you don't have any overlapping cells.  In Jasperstudio a good indication that cells aren't overlapping are when the outside frames is blue - green means you have an overlap, which will cause merging cells in excel output.

I wasn;t sure if you also perhaps meant you just had repeating column headers in the output either, the descritpion confused me a little - if you do have repeating column headings then just apply the following property: net.sf.jasperreports.export.xls.exclude.origin.keep.first.band.1=columnHeader

 

butlerc's picture
461
Joined: Feb 5 2010 - 2:09am
Last seen: 1 year 2 months ago

There are no overlapping cells - I learned how to detect that in my first 5 minutes with JS.  I don't have repeating column headers - we want one set of column headers at the top so that users can then sort the data.  I played around with it some and found that by putting column headers in the title bar I could reduce the gap between pages to a single blank row, so now I need to figure out how to make it easy for users to remove the blank rows before sorting.  Again, I can't use 'ignore pagination' because that causes a Java Heap Space error.

drummer54's picture
361
Joined: Mar 17 2014 - 7:34am
Last seen: 6 years 11 months ago

This was from awhile back, so I'm guessing you found an answer but in case anyone else has this issue:

The easiest way to get rid of the blank rows is to export as a CSV. Even when "ignore pagination" isn't selected, the CSV file format will not produce blank rows to represent additional pages (unlike XLS which will include them). By adding your field names into the title (as you have done) you get a spreadsheet with 1 row of field names and all the resulting data without blanks (without a Java Heap Space error from selecting ignore pagination).

 

seltsam1's picture
101
Joined: Sep 18 2015 - 4:20pm
Last seen: 6 years 6 months ago
Feedback