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

Enabling and disabling Images Based on "data present" or not


rromine

Recommended Posts

Okay so here is the problem. I have a report that tracks shipment with three options. The following below needs to be options that will show an image (which is a checkbox) :

______________________________________________

Freight Terms:

Prepaid: (no data)

Collect: (no data)

3rd Party: (this needs to be check marked with an image since the product is third party)

__________________________________________

Please use the image as a reference! Thank you so much. And please be specific as possible. Should it be a boolean value? etc. and what field to put it in. I assume its a conditional statement, I jsut dont know how to make a picture "VISABLE" or enabled.

xid-3655772_1

Link to comment
Share on other sites

  • Replies 5
  • Created
  • Last Reply

Top Posters In This Topic

Place the check mark image where you want it to be displayed, then set the printWhenExpression appropriately:

eg. ( $F{Method}.compareTo("Third Party")==0 )

If you aren't positive about whether the case will always be the same then force the strings on both sides of the comparison to either upper or lower case.

If you can't be sure that source string won't contain leading or trailing whitespace then use the .trim() function to be absolutley sure.

Link to comment
Share on other sites

Sill need help because!

The report still compiles when I added that print when expression, but it does not show the image, I also added a lable with that property and that is not displaying either.

BTW: If I add any new labels they compile so I know there appears to be nothing wrong with the report except that the boolean expression is just not working.

Maybe I can help you with some more details. See below:

Attachment 1: Shows the image I want to print when 3rd party function is true, Print when Expression is used with $F{BillTo}.compareTo("Third Party") == 0
do you see the red squiggly... wonder what it means lol
https://learn.usf.edu/bbcswebdav/xid-3659822_1

Attachment 2: Function BillTo --> look at the X image (which doesn't show on attachment 4) but then notice 3rd Party: --> $F function that goes to BillTo, that shows as true! lol
is this a logic error it appears to be :/
https://learn.usf.edu/bbcswebdav/xid-3659823_1

Attachment 3: XML page I am grabing from, or just look at link below to see full xml
https://learn.usf.edu/bbcswebdav/xid-3659821_1

Attachment 4: Report being run [iReport output]
https://learn.usf.edu/bbcswebdav/xid-3659824_1

Attachment 5 see link!: IDE Log showing missing reference errors, not sure what that is, but i doubt it is relevant
https://learn.usf.edu/bbcswebdav/xid-3659820_1

Thank you! I have put a lot of work into it, and I am working on other forms. But this is really bugging me! Hope the extra material helps and is not annoying.

 

Link to comment
Share on other sites

Your printWhenExpression is still incorrect.  Remember that it is a snippet of embedded Java, so you have to be very explicit about what you are doing.  If there's one thing Java excels at it's semantics.

new java.lang.Boolean( $F{Method}.compareTo("Third Party")==0 )

 

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