3rwin Posted March 8, 2007 Share Posted March 8, 2007 I'm trying to make a JasperReport in iReport that will exclusively be used to export to MS Excel. How can i make the report stretch every column to fit the data (width)? I just want to drop every column on the report without having to change the width for every one of them. I understand this would be a problem for a PDF export with the page width and all, but this is an Excel only report. Thank you. Link to comment Share on other sites More sharing options...
3rwin Posted March 14, 2007 Author Share Posted March 14, 2007 Anyone ? Help would be really appreciated. Link to comment Share on other sites More sharing options...
yogeshnagle Posted March 14, 2007 Share Posted March 14, 2007 Deal AllIt's very easy to design such reports with excel sheet.I sending a xml file along with an excel sheet. If you go though it. you can easily get rid of such problem.with best regardYogesh Nagle. [file name=Reports.zip size=5639]http://www.jasperforge.org/components/com_joomlaboard/uploaded/files/Reports.zip[/file] Link to comment Share on other sites More sharing options...
3rwin Posted March 14, 2007 Author Share Posted March 14, 2007 It's very easy to design such reports with excel sheet.I sending a xml file along with an excel sheet. If you go though it. you can easily get rid of such problem. Yogesh, Thanks for the help. But after looking at the xml i noticed that you made the width of your fields wide enough to contain the data. Correct me if i'm wrong. My intention was to let the columns stretch automatically. Link to comment Share on other sites More sharing options...
yogeshnagle Posted March 14, 2007 Share Posted March 14, 2007 Hye.Dear there is no way to let stretch it automaticlly.but you can stretch it down after taking enough width.I just show that way.....step1:- First go the text field property.step2:- then select "Text Field" tab and select stretch with overflow.step3:- now select "Common" tab. There select Print when detail overflows and from stretch type select relative to tallest object.thankswiht best regardYogesh Nagle. Link to comment Share on other sites More sharing options...
madhukiran Posted January 18, 2011 Share Posted January 18, 2011 All this is for vertical stretch.. jasper does not have an option yet for horizontal stretch of the columns/ dynamic width.. the workaround of having maximum size is not an exact solution for this Link to comment Share on other sites More sharing options...
ivit Posted January 20, 2011 Share Posted January 20, 2011 I am using the following in case of XLS reports:- add custom property to the report:net.sf.jasperreports.print.keep.full.text = true (to prevent data truncating)net.sf.jasperreports.export.xls.detect.cell.type = true (to enable later other data manupulation within the XLS)net.sf.jasperreports.export.xls.white.page.background = false (I dont like white color) :-) Basicaly, just design the average column width and the net.sf.jasperreports.print.keep.full.text will take care that no data is lost. 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