h.c.b. Posted July 19, 2017 Share Posted July 19, 2017 Hello Community, i have the following report with a main and a subreport. Is there a simple way to export this document (which is layouted for a PDF) directly to excel? Or is only the possibility to change the complete layout?Thanks for a short feedback and helpful answers. Link to comment Share on other sites More sharing options...
darth_fader Posted July 20, 2017 Share Posted July 20, 2017 You have two options:1) rework your layout to support both pdf and excel by remove all white space in bands, deleting unused bands, ignoring graphics, and adding configuration parameters for excel output such as those found here:http://jasperreports.sourceforge.net/config.reference.htmlFor example: see net.sf.jasperreports.export.xls.detect.cell.type2) create a separate report template optimized for each output typeI typically go with option two; PDF output deals with a fixed page width/height and printer friendly concerns, excel really doesn't. That alone can require significant differences in layouts. And if your requirements evolve, say now you need to create multiple worksheets in excel but need images etc for pdf, you may be forced at that point to create multiple templates. But like I mentioned, it comes with overhead. If I make a change in logic or computation and need consistent results across output formats, that change needs to be made in multiple places. Option one may or may not be simple, export your current report to excel as is and review the results. you may notice many extra columns and rows in excel and eliminating those can be tedious. In my experience it can be done but can be a pain. Also you have to filter out images, fonts, etc., enable cell type detection, check to see if things still work as expected in pdf output, so on and so on. 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