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

Column Print When expression for alternating Excel Workbook sheets advice requested


myusername01011

Recommended Posts

Hi,

I'm using the table component to render Excel with multiple worksheets within a single Excel workbook with iReport 5.5.  Sheets appear as District 1A, District 1B, District 2A, District 2B, District 3A, District 4B, etc ...

The District "B"(s) must hide the first column.   I don't have it working using new Boolean($F{DISTRICT}.toString().contains("A")) as the "Column Print When" expression to make the first column of a District XB hide. 

District XA or District XB are both in the table (component) details and also grouping by district (with District XA or District XB group names) allows me to alternate the sheets as outlined aboce. 

Please advise. 

(I'm beginning to suspect that perhaps the "Column Print When" expression may not be timed for evaluation properly and/or perhaps there is a "Column Export When" (or property) for Excel that I should be using for Excel sheets?)

If needed, please see Multiple worksheets for a single Excel workbook  for existing code.

Link to comment
Share on other sites

  • Replies 2
  • Created
  • Last Reply

Top Posters In This Topic

Top Posters In This Topic

By the way, both A and B sheets have the same columns (details; separated only for statistical reasons), but the first column should be hidden in B since the business data in the first column on a B sheet makes no business sense to my business users (and I'm using a single query to provide all the data in an attempt to keep things as simple as they can be).

Link to comment
Share on other sites

Another clue: My "Column Print When" expression, new Boolean($F{DISTRICT}.toString().contains("Z")). does actually hide the first column in all sheets (both A & B sheets in my case since that's what my data respresents).  Although, this is not the desired intent, it does provide some evidence that my table (component) "Column Print When" expression may in fact actually be getting evaluated.  Evaluated how is my question?  (Of course, there are no Z districts.)  

Perhaps, this points to "Column Print When" not fully handling and/or it's improper configuration for Excel specifically, despite having set  net.sf.jasperreports.export.xls.one.page.per.sheet, seemingly appropriately?  Perhaps, this may point to a bug/error in Jasper Excel (handling)?

Any tips? 

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