Subject: Your code is doing what it is told.
Icon in View/Column.>I have been trying different combinations but
just can’t get it right.
tick:=82;
cross:=81;
Approved:= tick;
Rejected:= cross;
@If (L1Status =“Approved” : “Rejected” ; tick ; cross)
The icon column displays a ‘Tick’ for both
Approved and Rejected and a ‘Cross’ for the
documents that should be blank??
Yes, because that is what your formula tell it to do. The @If statement you wrote says that if L1Status has a value that is in the list of values that you specify (which are “Approved”:“Rejected”), it should display the number specified in the variable ‘tick’, otherwise the value in ‘cross’.
The 3rd and 4th line of code is not even used.
I would write it like this:
@If(
L1Status=“Approved”; 82;
L1Status=“Rejected”; 81;
“” )
Or if you want to display the image resources instead:
@If(
L1Status=“Approved”; “icon_tick.gif”;
L1Status=“Rejected”; “icon_cross.gif”;
“” )
Display icon on form.
I have copied two icons into resources/images
icon_tick.gif
icon_cross.gif
If the field ‘L1Status’ equals
Approved then tick should display
Rejected then cross should display
Field has no value then both icons should not
be displayed.
Do you hide the icons by using a formula in
the Picture Properies?? and how.
You can do this two different ways.
The easiest might be to insert both images (in separate paragraphs), then use hide-when to hide/display them. You just select the paragraph and set the formula.
The other way is to create an image resource (you can insert any of the images). Then go to the picture properties and set teh source using a formula, just like the one above.