mpiaser Posted April 10, 2015 Share Posted April 10, 2015 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 More sharing options...
mpiaser Posted April 11, 2015 Author Share Posted April 11, 2015 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 More sharing options...
mpiaser Posted April 12, 2015 Author Share Posted April 12, 2015 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 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