Wednesday, April 20, 2005
JasperReports printwhenexpression Print When Expression
I use JasperAssistant for my JasperReports and I was trying my darndest to make a Double field on my report not print when it was zero.
I of course started playing with the Print When Expression field available when you select a field test field on your report and click properties. I could not figure out what the Expression should be and what it should return. I was getting very frustrated. I started looking on the Web and couldn't find anything to help me with my Expression.
I started looking at the errors very carefully and discovered that the Expression needs to return a Boolean object. So I started my expression off with new Boolean(
Then I worked on my expression. My field is of type Double so I had to say that
new Boolean( ($V{minimum}).doubleValue() > (new Double(0)).doubleValue() ).
This worked... and I was happy.
I got some help from the following site.
http://www.eclipseplugincentral.com/PNphpBB2+file-viewtopic-t-1433.html
