xantia95d Posted January 4, 2011 Share Posted January 4, 2011 Is there a way to export the data in excel so that it creates a new worksheet for each group. Else is there a way to export and create a worksheet for each subreport.Thanks Link to comment Share on other sites More sharing options...
szaharia Posted January 4, 2011 Share Posted January 4, 2011 Hi,When exporting to Excel, one can combine the JRXlsExporterParameter.IS_ONE_PAGE_PER_SHEET export parameter with some other pagination attributes, in order to get data grouping per sheet.When the document has to be represented as multiple sheets workbook, then always the JRXlsExporterParameter.IS_ONE_PAGE_PER_SHEET parameter should be set to Boolean.TRUE.In addition to this: If you need to represent each group on a separate sheet, then set the group's "isStartNewPage" attribute to true. If you need to represent each subreport on a separate sheet, then set the subreport's "runToBottom" attribute to true.Hope this helps,sanda Link to comment Share on other sites More sharing options...
szaharia Posted January 4, 2011 Share Posted January 4, 2011 Another way to group data on sheets, is to set to true the custom report element properties:net.sf.jasperreports.export.xls.break.before.rowand/ornet.sf.jasperreports.export.xls.break.after.rowIn this case the JRXlsExporterParameter.IS_ONE_PAGE_PER_SHEET parameter is automatically considered set to true.Hope this helps again,sanda Link to comment Share on other sites More sharing options...
xantia95d Posted January 4, 2011 Author Share Posted January 4, 2011 Sanda, Thanks for your response, the only other question I have therefore is that if I set one page per sheet, will I not end up getting multiple sheets when the automatic page breaks occur, ie when the group extends over more than one page as some of the grouped results extend to over 500 lines per group and others only about 10 lines. If I use the IS_IGNORE_PAGINATION, then as I understand it, the report will ignore all page breaks.Regards and thanks againTerry Link to comment Share on other sites More sharing options...
szaharia Posted January 4, 2011 Share Posted January 4, 2011 In this case the second solution here is better: try to use one of the custom properties speciefied above, or both of them, depending on your report's specific needs, and let the IS_ONE_PAGE_PER_SHEET parameter unset. So, the inital single document sheet will be broken each time an element with such a property occurs.Regards,sandaPost Edited by shertage at 01/04/2011 13:41 Link to comment Share on other sites More sharing options...
xantia95d Posted January 4, 2011 Author Share Posted January 4, 2011 Sanda, Thanks for you help - and Happy New Year.RegardsTerry Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now