Jump to content
We've recently updated our Privacy Statement, available here ×

Excel Report with Crosstab


hussainkali

Recommended Posts

I have created a report using a Crosstab which I intend to use for reporting XLS and XLSX reports.  I have placed the crosstab in the summary band and it all seems to work well.

However, when the number of columns is too high the columns wrap around onto the 'next page' (i.e. under the first lot of data).

Is there anyway that I can just get a continuous report going from left to right without the report wrapping round?  I have tried setting the JasperPrint ignore pagination property, but this hasn't solved the problem (it does make a difference but it's not how I'd like it). 

I've attached example reports, one with and one without pagination.

Can someone please help :(



Post Edited by hussainkali at 06/09/2010 14:21
Link to comment
Share on other sites

  • Replies 5
  • Created
  • Last Reply

Top Posters In This Topic

ok, I've just found that if I set the Crosstab property PROPERTY_IGNORE_WIDTH then it doesn't wrap around to a new 'page'. However, it looks like I can only set this property globally, which isn't much good to me as I've have to export the report as PDF as well (user can select either PDF, XLS or XLSX).

 

Anyone got any ideas?

Link to comment
Share on other sites

I've tried the following code, and although the property does seem to be getting set, it doesn't seem to have any effect on the report output.

If anyone knows how to do this I'd really appreciate the help!

Code:
if (getSelectedReportFormatName(outputFormatId).equals("Excel 2007")) {	jasperReport.setProperty(JRCrosstab.PROPERTY_IGNORE_WIDTH, "true");}else {	jasperReport.setProperty(JRCrosstab.PROPERTY_IGNORE_WIDTH, "false");}
Link to comment
Share on other sites

Although I didn't get any feedback, just incase anyone else has the same issue, I've managed to get it working:

Using the conditional property set in my last post didn't work because the crosstab in the report template had the property set to false.  I didn't realise that by setting this property in the report template that it could not be changed at runtime (the property being specified in the crosstab overrides any global report property setting).

By removing ignoreWidth="false" altogether from the crosstab definition allowed me to set the property globally before filling the report.

Hope this helps someone else,

Hussain Ali

Link to comment
Share on other sites

  • 4 years later...
  • 3 years later...

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