Click here to Skip to main content
Click here to Skip to main content

Suppress field in Crystal Reports

, 5 Dec 2012 CPOL
Rate this:
Please Sign up or sign in to vote.
Suppress field in Crystal Reports.

Introduction

When implementing a system we are normally inserting default values for the fields in the database rather than inserting NULL values. But when we are retrieving data from the database and visualizing them from a report, all the default values come to the report.

Background

To overcome the situation, we can use two methods. One method is mention that default value on a report and consider it as default value to that relevant field. 

Using the code

The other method is use the Suppress option given by the Crystal Reports engine. To use that option, first you have to create the report the normal way.  Then select the field you have to suppress and right click on it. Then you have to select Format Object menu item from the popup menu.

Then it will open the Format Editor window which will enable us to do formatting. Now navigate to the Common tab of the window. Now check the Suppress check-box and click the button in front of the Suppress check box. 

The Formula Workshop window will then open. 

In here you have to provide a boolean value. Based on it, the value of the field will visible in Crystal Reports. If the provided statement is true, then the field value will be displayed. If the statement is false, then the field value will not appear. 

In this scenario, the default value is 1901/01/01. To suppress this, I wrote a formula which checks whether the value of the field is 1901/01/01 or not.

History

The original blog post can be found in my blog from this link.

License

This article, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

Share

About the Author

Eranda Ketawalage
Systems Engineer
Sri Lanka Sri Lanka
No Biography provided
Follow on   Twitter

Comments and Discussions

 
-- There are no messages in this forum --
| Advertise | Privacy | Terms of Use | Mobile
Web01 | 2.8.1411023.1 | Last Updated 5 Dec 2012
Article Copyright 2012 by Eranda Ketawalage
Everything else Copyright © CodeProject, 1999-2014
Layout: fixed | fluid