Crystal Reports – showing Details or Summary based on a parameter

You may have created a report and you want users to have the option of either just seeing the summary level or the full details. This can be achieved using a parameter. Create a new parameter  called Summary or Detail.

Parameter Dialog box

In the Value section, type two values – Summary and Detail. Click OK.

Go to the Design tab, right-click over the left-hand area and select Section Expert.

Section Expert

In the Details section , check the Suppress (No Drill-Down) box, then click the Formula  button to the right of it. The formula should be {?Summary or Detail}=”Summary”.

Click Save and Close then click OK.

Refresh the report and you will be asked whether you want a Detail or a Summary report. Make your selection and click OK.

If you select a summary report, you may find that you have field headings visible that are not relevant to your report.

Summary Report1

Also, it may look better if, in this example, the Order Amount column was nearer the left. Select the field headings you do not wish to see in the summary report, right-click and click Format Objects. On the Common tab, check the Suppress box, then click the Formula button to the right. In the Formula Workshop type {?Summary or Detail}=”Summary” then click Save and Close. Click OK. The field headings are suppressed. To move the summary column nearer to the left, you have to know that widths in Crystal Reports are measured in twips and that there are 1440 twips in an inch! To move this column nearer to the dates, from Design view, right-click in the column and select Size and Position. Click on the formula button between X and Y.

Type in something like:

if {?Summary or Detail}=”Summary” then -3000. Click Save and Close, then click OK.

Repeat for any additional fields to be moved to the left.

Summary Report2

Your fields are now closer to the grouping column.

Find out more about our Crystal Reports training Sydney, Australia or our Crystal Reports courses London, Middlesex, Surrey or our Crystal Reports training Dorset, Hampshire, Wiltshire, England.

About jdonbavand

I am a trainer of Microsoft Office, Microsoft Project and Crystal Reports. I have called my blog "If Only I'd Known That...." because I hear it so many times in training sessions. In fact, if only I had a £100 (or 150 Aussie dollars)for every time someone says "If only I'd known that." ....
This entry was posted in Uncategorized and tagged , , . Bookmark the permalink.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s