Suppress field in Crystal Reports


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

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

The other method is use the Suppress option given by the Crystal report engine.

To use that option, first you have to create the report in 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 Format Editor window which will enable to do formatting.

Now navigate to Common tab of the window.

Now check the Suppress check-box and click the button in front of the suppress check box.






Then Formula Workshop window will open.

In here you have to provide a Boolean value . based on it the value of the field will visible in the crystal report. If the provided statement gives true, then the field value will display. If the statement gives false, then the field value wan't appear.

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


Comments

Popular posts from this blog

Apply CSS styles to SharePoint Web parts

SharePoint Number Column Without Commas

Create Summary view of SQL Datatable