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

Hide a column


mpiaser

Recommended Posts

I need to be able to hide a column (not display it in excel) if it contains no data.  I think the PrintWhenExpression property is supposed to do the trick but I can't get it to work.

For testing, I've created a simple expression. <printWhenExpression><![CDATE[new Boolean(true)]]></printWhenExpression>

This is in the reportelement of the text field.  It doesn't matter if I use "true" or "false", the column still shows up.

I am using 4.1.2.  I can't figure out how to attach the actual code to this posting.  When I try to paste something into this post, it will not paste.

 

 

Link to comment
Share on other sites

  • Replies 2
  • Created
  • Last Reply

Top Posters In This Topic

I am able to get a column ignored when it has no value using new Boolean($F{off_peak_free_minutes}.trim().equals("")==false)

 

Now I need to do ignore a column that has a value of ZERO. I can't get the syntax right - for example, even something as simple as new Boolean(1==2) shows the 1 and 2 with a red underline.

Link to comment
Share on other sites

The following printwhenexpression works new Boolean(Double.valueOf($F{push_talk_direct_connect_minutes})!=0 && new Boolean(!$F{push_talk_direct_connect_minutes}.trim().equals("")))

 

Except if one of the cells has a value of zero, it prints as a blank. If all cells have a value of zero, the column is correctly removed.

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