Jump to content

Print When Expression


gr4nt4

Recommended Posts

Hi all

 

Using 'Print When Expression' I'm looking to do two things

 

1. When a field value is above a certain value .. do not print ie somthing like

 

 

$F{myVal} <=100 then print value else do not print

 

 

2.Always hide a field

 

I tried Boolean (true) but an error

 

as you may guess I'm not a java man

 

Thanks for the help

Link to comment
Share on other sites

  • Replies 5
  • Created
  • Last Reply

Top Posters In This Topic

Top Posters In This Topic

  • 2 weeks later...

Hi All

 

I find this really strange. I am using Java 5. In java 5 Boolean and boolean are both allowed and dont need to be casted. According to jasperreports, the printWhen expression must contain valid Java code and must return a boolean. Then why on earth must the print when expression generate Boolean and not boolean. For example:

 

$F{FieldName} != null (Mot allowed)

new Boolean($F{FieldName} != null) (Is allowed)

 

That is really strange behavior because in Java 5 it would be

 

$F{FieldName} != null (Is allowed)

new Boolean($F{FieldName} != null) (Is allowed)

 

Could someone explaing this please?

Link to comment
Share on other sites

Hi Lucianc

 

Thanks for your quick response. In short for those of you who dont want to follow the link:

 

To compile Java 1.5 code with this compiler, you might need to explicitly set the following properties in your jasperreports.properties file:

 

Code:

org.eclipse.jdt.core.compiler.source=1.5
org.eclipse.jdt.core.compiler.compliance=1.5
org.eclipse.jdt.core.compiler.codegen.TargetPlatform=1.5
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...