Business Intelligence

Giving Users More Than an Empty Report

Occasionally, using an INNER JOIN or selection criteria in Crystal Reports, can result in an empty recordset and a blank report. For instance your user may be trying to run an accessioning report on unaccessioned objects, or a valuation report on records that have never had values entered into the system. These scenarios could create frustrations for users who may not understand why their report is blank, but there is a simple solution to avoid that blank sheet of paper.

We are going to modify the canned Alternate Numbers report, to create a message that is displayed if the result set does not include any Objects with Alternate Numbers. Start by opening the report. Add a new Report Footer, and include a text object with your desired text, something along the lines of “There are no records with alternate numbers in your selection.”

The Alternate Numbers report in Design view.

Now open the Section Expert for the Report Footer you just created, and click the Formula button next to “Suppress (No Drill-Down).” We will be creating a formula that leverages the Running Total field Count.

1
2
// Suppression formula
if {#Count} = 0 then false else true 

Save your formula and your updated report, and try it out with a group of records, preferrably one without any alternate numbers.

The completed Alternate Numbers report in Preview.

You may want to cleanup the report by suppressing the group headers when there are not any records to return. What other reports do you have that you could use this technique in?

Thanks for taking the time to read my post – I hope you found it helpful.
Leave feedback in the comments below.

If this post save you time, then consider sharing it with your friends and colleagues. If it saved you some money, then please consider buying me a coffee. If you want to know when I publish new content, then subscribe to my feed. Your support encourages me to write more. Thanks!

Leave a Comment