SAP Knowledge Base Article - Public

1803119 - How to suppress the Text objects when Crystal Reports contains no data?

Symptom

  • While exporting to Text format, how to suppress the Text objects when Crystal Reports contains no data.
  • Text file should not show the text data if there is no data in the report.

Environment

  • Crystal Reports 2008
  • Crystal Reports 2011

Reproducing the Issue

  1. Create a Crystal Report with no database field in it.
  2. Insert a Text Object in any section of the report.
  3. Export the Crystal Report to the Text format.
  4. The Text file generated will show the Text in it.

Resolution

1. In Crystal Reports, activate the Design tab.
2. Right click on the text field and select Format Field...
3. Click on the Common tab.
4. Click on the formula edit button next to Suppress (this allows you to edit the field suppression formula).
5. Add the suppress formula as:
    IsNull({TABLENAME.FIELDNAME})
6. If the TABLENAME.FIELDNAME database field is NULL then the text field will be suppressed (invisible).
7. But, the tooltip text will still be visible if you hover your mouse over the invisible field while viewing the report in the Preview Panel.
8. If you want to suppress the tool-tip text too, then add the same suppression formula to the formula edit button next to Tool-Tip Text in the Common tab.

Keywords

Crystal Report Text object , KBA , BI-RA-CR , Crystal Reports designer or Business View Manager , How To

Product

Crystal Reports 2008 V1