jhopkinsjorbe.com Posted October 16, 2008 Share Posted October 16, 2008 I have many reports written in JasperReports and deployed on the JasperServer. I need the html version onscreen to paginate and the excel/CSV exports to not paginate. Pagination in excel exports doesn't make any sense to me. Is there an option to turn off pagination for excel exports on the JasperServer? My users want to use the excel exports for analysis and with the page headers embeded in the output it makes that impossible without going through and removing all the headers. I have looked around in the code and can see where I could possibly add a property to the xmlExporterBean and then pass that along to the excel export logic. If there is no way to turn this off out-of-the-box any help/insight into making the code changes would be appriciated. I have attached a sample export.Cheers, Joe Link to comment Share on other sites More sharing options...
anandharaj Posted October 17, 2008 Share Posted October 17, 2008 hi,You can change the setting in $JASPER_ROOT/WEB-INF/applicationContext.xml- set "onePagePerSheet" to "false"Further details can be found in my blog: www.raj2u.net Code: <bean id="xlsExportParameters" class="com.jaspersoft.jasperserver.api.engine.jasperreports.common.XlsExportParametersBean"> <property name="detectCellType" value="true"/> <property name="onePagePerSheet" value="false"/> <property name="removeEmptySpaceBetweenRows" value="false"/> <property name="removeEmptySpaceBetweenColumns" value="true"/> <property name="whitePageBackground" value="false"/> <property name="ignoreGraphics" value="false"/> <property name="collapseRowSpan" value="true"/> <property name="ignoreCellBorder" value="true"/> <property name="fontSizeFixEnabled" value="true"/> <property name="maximumRowsPerSheet" value="0"/> <property name="xlsFormatPatternsMap" ref="formatPatternsMap"/> </bean> Link to comment Share on other sites More sharing options...
jhopkinsjorbe.com Posted December 8, 2008 Author Share Posted December 8, 2008 Ths solution worked along with these settings in my jasperreports.properties file.net.sf.jasperreports.query.executer.factory.sql=com.jaspersoft.jasperserver.api.engine.jasperreports.util.JRTimezoneJdbcQueryExecuterFactory#limit the crosstab bucket/measure count to prevent out of memory errorsnet.sf.jasperreports.crosstab.bucket.measure.limit=100000# suppress page headers and footers when exporting to XLS net.sf.jasperreports.export.exclude.origin.band.1=pageHeadernet.sf.jasperreports.export.exclude.origin.band.2=pageFooter# this gets rid of the repeating column headers and footers in excel exportsnet.sf.jasperreports.export.xls.exclude.origin.band.1=columnHeadernet.sf.jasperreports.export.xls.exclude.origin.band.2=pageFooter# keep the first column header on exportnet.sf.jasperreports.export.xls.exclude.origin.keep.first.band.1=columnHeader# report exporter hints override export parametersnet.sf.jasperreports.export.parameters.override.report.hints=false# use the workaround for the Sun JDK Glyph synchronization bugnet.sf.jasperreports.text.measurer.factory=net.sf.jasperreports.engine.util.JdkGlyphFixTextMeasurerFactory# the fast/single line text measurer factorynet.sf.jasperreports.text.measurer.factory.single.line=com.jaspersoft.jasperserver.api.engine.jasperreports.util.SingleLineTextMeasurerFactory# other excel options#net.sf.jasperreports.export.xls.remove.empty.space.between.rows=true#net.sf.jasperreports.export.xls.remove.empty.space.between.columns=true#net.sf.jasperreports.export.xls.detect.cell.type=true#net.sf.jasperreports.export.xls.create.custom.palette=true Thanks, Joe Link to comment Share on other sites More sharing options...
jhopkinsjorbe.com Posted December 9, 2008 Author Share Posted December 9, 2008 How do you remove pagination from CSV exports? I got it working in Excel from your suggestions but I still get a reapeating footer when exporting to CSV.Here are my jasperreports.properties#Jdbc Timezone execution factorynet.sf.jasperreports.query.executer.factory.sql=com.jaspersoft.jasperserver.api.engine.jasperreports.util.JRTimezoneJdbcQueryExecuterFactory#limit the crosstab bucket/measure count to prevent out of memory errorsnet.sf.jasperreports.crosstab.bucket.measure.limit=100000# suppress page headers and footers when exporting to XLS net.sf.jasperreports.export.exclude.origin.band.1=pageHeadernet.sf.jasperreports.export.exclude.origin.band.2=pageFooter# this gets rid of the repeating column headers and footers in excel exportsnet.sf.jasperreports.export.xls.exclude.origin.band.1=columnHeadernet.sf.jasperreports.export.xls.exclude.origin.band.2=pageFooter# keep the first column header on export to XLSnet.sf.jasperreports.export.xls.exclude.origin.keep.first.band.1=columnHeader# this gets rid of the repeating column headers and footers in CVS exportsnet.sf.jasperreports.export.cvs.exclude.origin.band.1=columnHeadernet.sf.jasperreports.export.cvs.exclude.origin.band.2=pageFooter# keep the first column header on export to CVSnet.sf.jasperreports.export.cvs.exclude.origin.keep.first.band.1=columnHeader# report exporter hints override export parametersnet.sf.jasperreports.export.parameters.override.report.hints=false# use the workaround for the Sun JDK Glyph synchronization bugnet.sf.jasperreports.text.measurer.factory=net.sf.jasperreports.engine.util.JdkGlyphFixTextMeasurerFactory# the fast/single line text measurer factorynet.sf.jasperreports.text.measurer.factory.single.line=com.jaspersoft.jasperserver.api.engine.jasperreports.util.SingleLineTextMeasurerFactory# other excel options (applicationContext.xml overrides these settings)#net.sf.jasperreports.export.xls.remove.empty.space.between.rows=true#net.sf.jasperreports.export.xls.remove.empty.space.between.columns=true#net.sf.jasperreports.export.xls.detect.cell.type=true#net.sf.jasperreports.export.xls.create.custom.palette=true Thanks, Joe Link to comment Share on other sites More sharing options...
carminez Posted December 9, 2008 Share Posted December 9, 2008 I'm not sure if those options work, they aren't listed here: http://jasperforge.org/website/jasperreportswebsite/trunk/config.reference.html?group_id=252Also, maybe you have a spelling error, you have "cvs" instead of "csv" in what you paste from your properties file. Link to comment Share on other sites More sharing options...
jhopkinsjorbe.com Posted December 9, 2008 Author Share Posted December 9, 2008 Oops.. I meant .csv. in the above code sample. :-) # this gets rid of the repeating column headers and footers in CSV exports net.sf.jasperreports.export.csv.exclude.origin.band.1=columnHeader net.sf.jasperreports.export.csv.exclude.origin.band.2=pageFooter # keep the first column header on export to CSV net.sf.jasperreports.export.csv.exclude.origin.keep.first.band.1=columnHeader Link to comment Share on other sites More sharing options...
jhopkinsjorbe.com Posted December 9, 2008 Author Share Posted December 9, 2008 Thanks for the link...that's exactly what I need... Link to comment Share on other sites More sharing options...
jhopkinsjorbe.com Posted December 9, 2008 Author Share Posted December 9, 2008 Ok, that worked once I fixed my typing errors. Same properties as Excel just replace xls with csv and pagination is removed on export. Thanks, Joe Link to comment Share on other sites More sharing options...
carminez Posted December 11, 2008 Share Posted December 11, 2008 Any ideas on how to remove the Page Header from the CSV? I really only need the column headings in the CSV, having the Page Header display requires the user to have to manipulate the CSV to import the data. Link to comment Share on other sites More sharing options...
jasons Posted March 12, 2009 Share Posted March 12, 2009 I noticed that if there is a sub-report in the band being excluded, the band will not get excluded. Does anyone know why this is, is there any way around it? Link to comment Share on other sites More sharing options...
lucianc Posted March 23, 2009 Share Posted March 23, 2009 jasonsWrote: I noticed that if there is a sub-report in the band being excluded, the band will not get excluded. Does anyone know why this is, is there any way around it? That's mainly a design bug of JasperReports. The next JR release will make possible a workaround for this which will require the subreport to be nested inside a frame in the master report. We are also investigating proper solutions to this for the long term.Regards,Lucian Link to comment Share on other sites More sharing options...
cdeal Posted August 12, 2009 Share Posted August 12, 2009 Can you offer any more details on this solution? A number of JR versions have been released since this post. Is there a workaround for this subreport problem? Post Edited by cdeal at 08/12/2009 17:27 Link to comment Share on other sites More sharing options...
shaily09 Posted December 1, 2009 Share Posted December 1, 2009 I used the properties below to# this gets rid of the repeating column headers and footers in excel exportsnet.sf.jasperreports.export.xls.exclude.origin.band.1=columnHeadernet.sf.jasperreports.export.xls.exclude.origin.band.2=pageFooter# keep the first column header on export to XLSnet.sf.jasperreports.export.xls.exclude.origin.keep.first.band.1=columnHeaderCan anybody please tell me how do I keep last single footer for the complete exportedreport in CSV/XLS. Thanks in advance. Link to comment Share on other sites More sharing options...
lucianc Posted December 11, 2009 Share Posted December 11, 2009 cdealWrote: Can you offer any more details on this solution? A number of JR versions have been released since this post. Is there a workaround for this subreport problem? The workaround is to place the subreport inside a frame element (in the master report). There's no other solution at the moment.Regards,Lucian Link to comment Share on other sites More sharing options...
lucianc Posted December 11, 2009 Share Posted December 11, 2009 shaily09Wrote: Can anybody please tell me how do I keep last single footer for the complete exported That's not currently supported. Wouldn't the summary band work for you?Regards,LucianPS: Please post new threads if your questions is not directly related to the original topic. Discussing several items in a single thread is messy. Link to comment Share on other sites More sharing options...
jogrey Posted October 13, 2010 Share Posted October 13, 2010 I have a quite similar problem, if i succeed correctly to remove from export page titles, and column headers, i'am not able to do the same with a group band. I tried this with success : net.sf.jasperreports.export.xls.exclude.origin.band.1=pageHeadernet.sf.jasperreports.export.xls.exclude.origin.band.2=pageFooter And this without success (Product is the name of the group): net.sf.jasperreports.export.xls.exclude.origin.band.3=columnHeadernet.sf.jasperreports.export.xls.exclude.origin.band.4=groupHeadernet.sf.jasperreports.export.xls.exclude.origin.group.5=columnHeadernet.sf.jasperreports.export.xls.exclude.origin.group.6=groupHeadernet.sf.jasperreports.export.xls.exclude.origin.band.7=Productnet.sf.jasperreports.export.xls.exclude.origin.group.8=Product Column headers are always exported, is there something special for groups ? Thank you. Post Edited by jogrey at 10/13/2010 10:03 Link to comment Share on other sites More sharing options...
jogrey Posted October 13, 2010 Share Posted October 13, 2010 I found the solution : net.sf.jasperreports.export.xls.exclude.origin.band.title=titlenet.sf.jasperreports.export.xls.exclude.origin.band.pageHeader=pageHeadernet.sf.jasperreports.export.xls.exclude.origin.band.columnHeader=columnHeadernet.sf.jasperreports.export.xls.exclude.origin.band.columnFooter=columnFooternet.sf.jasperreports.export.xls.exclude.origin.band.pageFooter=pageFooternet.sf.jasperreports.export.xls.exclude.origin.band.lastPageFooter=lastPageFooter #### the solution #####net.sf.jasperreports.export.xls.exclude.origin.keep.first.band.Product=Productnet.sf.jasperreports.export.xls.exclude.origin.keep.first.band.Product=groupHeadernet.sf.jasperreports.export.xls.exclude.origin.keep.first.group.Product=Product net.sf.jasperreports.export.xls.exclude.origin.band.Product=Productnet.sf.jasperreports.export.xls.exclude.origin.band.Product=groupHeadernet.sf.jasperreports.export.xls.exclude.origin.group.Product=Product Link to comment Share on other sites More sharing options...
pruebas3d Posted October 28, 2010 Share Posted October 28, 2010 Hi,I was looking a solution for this problem and this post helped me, but I was working with Servlets and I didn't know how to apply these properties. Finally I found the way.If anyone is looking for the same solution but exporting the Excel from a Servlet you can do this to remove pagination: Code: Post Edited by pruebas3d at 10/28/2010 14:00 Link to comment Share on other sites More sharing options...
asepyudiyurdany Posted January 15, 2013 Share Posted January 15, 2013 hi, i have similar problem, but not work if i used this solution, because i'm using table component for my report, and column header still repeat, please help.. dany Link to comment Share on other sites More sharing options...
andre.erasmus Posted July 3, 2013 Share Posted July 3, 2013 This works for xls & xlsx , but what will the fix for CSV be ? 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