Jump to content

Excel and column stretch


3rwin

Recommended Posts

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

  • Replies 6
  • Created
  • Last Reply

Top Posters In This Topic

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

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.

thanks

wiht best regard

Yogesh Nagle.

Link to comment
Share on other sites

  • 3 years later...

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

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