What is the best way to display a checkbox in a Crystal Report?
Example: My report has a box for "Male" and "Female", and one should be checked.
My current workaround is to draw a small graphical square, and line it up with a formula which goes like this:
if {table.gender} = "M" then "X" else " "
This is a poor solution, because changing the font misaligns my "X" and the box around it, and it is absurdly tedious to squint at the screen and get a pixel-perfect alignment for every box (there are dozens).
Does anyone have a better solution? I've thought about using the old-style terminal characters, but I'm not sure if they display properly in Crystal.
Edit: I'm using Crystal XI.
I need to mention here which is font need's to select here "Wingdings"
An alternative to images could be to use the Wingdings font; Characters
0xFE
(checked) and0xA8
(unchecked).if {Your Field} = true then Chr(254) else Chr(168)
Add the Formula field to the report where you want the checkbox to appear.
Now change the font of the formula field to Wingdings.
I never use a box...I always use a textfield object with a full border, centered alignment and bold. Type an X inside to size it right. Erase the "X". Copy/paste as many as you need.
Then I create all the formulas that return either "X" or " " (the space is important, otherwise border will not display on the text object). Then simply plop the formula fields into the right boxes.
Also, if you want to align these bordered text objects you need to remove the border before aligning. That bug really annoys me!
Try a pair of images with a conditional formula for visibility