Checkbox in Crystal Report

What's the best way to display a checkbox in a Crystal Report?

Example. My report has a field for "Male" and "Female" and needs to be checked.

My current workaround is to draw a small graphical square and line it up with a formula that looks like this:

if {table.gender} = "M" then "X" else "  "

      

This is a bad solution because changing the font misaligns my "X" and the box around it, and it's absurdly tedious to squint at the screen and get pixel-perfect alignment for each box (there are a few dozen).

Does anyone have a better solution? I was thinking about using old style characters, but I'm not sure if they display correctly in Crystal.

Edit: I am using Crystal XI.

0


source to share


7 replies


Try to create a couple of images with a conditional formula for visibility



+2


source


If {Table.Field} = True Then

'Display the checkbox of your choice here

Formula = Chr(254)

Else

'Display empty checkbox

Formula = Chr(168)

End If

      



+6


source


An alternative to images could be using the Wingdings font; The symbols are 0xFE

(marked) and 0xA8

(not marked).

+4


source


I need to mention here where the font should choose here "Wingdings"

If {Table.Field} = True Then

'Display the checkbox of your choice here

Formula = Chr(254)

Else

'Display empty checkbox

Formula = Chr(168)

End If

      

+3


source


I never use a box ... I always use a textbox object with full outline, centered alignment and bold. Type X inside to change it correctly. Delete the "X". Copy / paste as many as you need.

Then I create all formulas that return either "X" or "" (space is important, otherwise the border will not appear on the text object). Then just paste the formula fields into the fields you want.

Also, if you want to align these border text objects, you need to remove the border before aligning. This error really annoys me!

+2


source


2 photos
1 - Empty box
2 - Checked box

Display the right image using formula

+1


source


  • Create a formula field and use the following formula

if {Your Field} = true, then Xp (254) is also Xp (168)

  1. Add a formula field to the report that you want to check the box for.

  2. Now change the font of the formula field to Wingdings.

0


source







All Articles