Print Page | Close Window

Hide/Show images besed on field value

Printed From: Crystal Reports Book
Category: Crystal Reports 9 through 2020
Forum Name: Report Design
Forum Discription: The best way to design a report and problems you have encountered
URL: http://www.crystalreportsbook.com/forum/forum_posts.asp?TID=7457
Printed Date: 29 Apr 2024 at 4:18am


Topic: Hide/Show images besed on field value
Posted By: waely
Subject: Hide/Show images besed on field value
Date Posted: 21 Aug 2009 at 2:20pm
Hi,
I have a field that has values (1,2,3) and I would like to show three images (green, yellow, red) based on the value of that field.
 
is there a way I can set the path of the image based on the field value or can I just set the width and length sizes of the images to 0 when they're not equal to that field value?
 
any suggestion is appreciated.
thanks



Replies:
Posted By: Jyri
Date Posted: 24 Aug 2009 at 12:12am
Hey,
 
I think there are few ways to do this, but I would do it like this :
 
First insert a text field to report where you want to show the colors. Then right click the text field and select format text.
Go to Border tab, and there press the x-2 in backgroud.
Put something like this to the formula field :
 
if {table.fieldname} =1 then green else
if {table.fieldname} =2 then yellow else
{table.fieldname} =3 then red
 
- Jyri


Posted By: waely
Date Posted: 24 Aug 2009 at 8:30am

Jyri,

I have images that I like to show instead of changing the bg color.
thanks


Posted By: DBlank
Date Posted: 24 Aug 2009 at 8:59am
can't remember how to change the pic based on this but you can easily add all 3 objects (pics) to the space you want to display then conditionally suppress each based on your needs 
e.g.
pic #1 suppress as: NOT ({table.field}=1)
pic #2 suppress as: NOT ({table.field}=2)
pic #3 suppress as: NOT ({table.field}=3)


Posted By: waely
Date Posted: 24 Aug 2009 at 10:58am
thanks. that worked.



Print Page | Close Window