Search code examples
crystal-reports

How to show different icons in Crystal reports depending on the field value?


We are using Crystal Report 12 in one of our projects. Currently I need to create report template which should show different icons based on the some field value. That field contains a number, storing some kind of status and I have several icons corresponding some statuses.

At the moment I can't figure out how to implement such a thing in Crystal Reports designer.

Could someone please help me?


Solution

  • Showing and hiding graphical objects in CR based on a formula is almost exactly like showing and hiding text labels based on certain criteria.

    First, you need to add each icon to your report detail section by choosing the Insert menu, and then select Picture...

    Once all your icons are inserted, you will need to edit the suppression formula by right-clicking on each icon and choosing Format Graphic. On the first tab of the Format Editor, you have a Suppress option just like you do for other report objects. Click on the formula button next to Suppress to add a suppression formula to the icon describing when it should be shown or hidden.