zaterdag 28 september 2013

Crystal Reports vs. SS RS / Report Builder: Displaying Boolean Field Types

Crystal Reports

In Crystal Reports a Boolean Field type is simply represented by the words True or False when you include such a field in your report.
  • Right-click the field.
  • Choose Format Field.
  • Choose the tab Boolean.

Nice, but not as nice as when you would change the True and False into checked or unchecked check boxes.
  • Right-click the field.
  • Choose Format Field.
  • Choose the tab Font.
  • Pick the font Wingdings.
  • Choose the tab Common.

  • Click the X+2 after Display string.
  • Fill in the Formula:

if {Products.Discontinued}= true then
    chr(254) //checked checkbox
else
    chr(111) //unchecked checkbox
  • Click OK.
Then we will get:


Report Builder / Reporting Services

Report Builder will normally also represent a Boolean Field type as either True or False
  • In order to change it here, add a column to the tablix.
  • Right click it.
  • Choose Expression.

  • Fill in the Formula as shown in the window or like here
=IIF(Fields!Discontinued.Value=True, Chr(254), Chr(111))
  • Click OK.
  • Right click the expression.
  • Choose Text Box Properties.
  • Choose Font.
  • Choose Wingdings.
  • Click OK.
When you now run the report the result would be the same as in Crystal Reports.




Een reactie posten