Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

T/F with image 1

Status
Not open for further replies.

Bell1991

Programmer
Aug 20, 2003
386
US
I have several fields that return true or false and rather than displaying True/False I would like them to display an image (i.e., check mark for true and an empty box for false). Is this possible? I know how to color the box in if it is true - but i would like to display an image.

Thanks in advance
-Bell
 
Create two sections on your report - one with a checked box, and another with an unchecked box - you can then use SELECTIVE SUPRESSION on those sections.

Those sections should also "Underlay sections below".
 
Create a formula:

if {table.field} = true then
chr(254)
else chr(168)

Then format the formula to the wingdings font( format->field->font->wingdings).

-LB
 
thanks for the suggestions.

When i try the above i get the following error:

The formula result must be a boolean.

The fields i am checking return true/false - but are not boolean fields in the db.

Thanks again
 
Not sure how to interpret that--guess it must be a string that might have a null option? Try:

if isnull({table.field}) or
{table.field} = "False" then
chr(168) else
chr(254)

This assumes that you would a null evaluated as false.

-LB
 
Maybe i am putting the forumla in the wrong spot. I am putting it at: common->Surpress->x+2.

Is this the correct place?
 
Another alternative to using different sections as suggested by MJRBIM and if you want to use images instead of Wingdings as LB suggests,is to have the images entered on the same section and just conditionally suppress whichever one you don't want to see, based on the field you want. Just align the two variants (eg Checked and uncheck boxes) with each other and go into the format Graphic option and enter the required suppression formula.
 
Thanks MPeacock,

I would much rather have images rather than wngdings - as i am having problems displaying them on the web.

Can you further explain how to use images?
 
No worries.
Just insert the two images eg image1(checked) and image2(unchecked) into the appropriate section of your report. Go to the Format Graphic option of the right-click menu. Under the Suppress X+2 formula for image1(checked)enter something similar to LB's formula eg:

if isnull({table.field}) or
{table.field} = "False" then True
else False

This should suppress the checked image if the table.field is False or null.
On the image2(unchecked)graphic enter:

if isnull({table.field}) or
{table.field} = "False" then False
else True

Align the two images so they are basically one on top of the other and they should display the relevant image dependent on the table.field result.
What effect putting the page on the web does, I don't know - but certainly this should work for 'normal' reporting.
Hope this helps!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top