Jump to content
We've recently updated our Privacy Statement, available here ×

Removing page breaks in Excel export


drummer54

Recommended Posts

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?

Link to comment
Share on other sites

  • Replies 3
  • Created
  • Last Reply

Top Posters In This Topic

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

 

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

  • 5 months later...

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

 

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