Crystal Reports Help..

Soldato
Joined
11 Feb 2004
Posts
4,532
Location
Surrey, UK
Hi,
Not sure if there are any CR developers out there but here goes.

I'm trying to get a report to display the last record in a group.

The report is grouped by Incident Number, then within that there are numerous records - each with an incrementing sequence number.

I only want the last sequence number in the assoc. group? I've tried using maximum() but this doesn't work.

Preferably I'd like to include this at runtime as opposed to surpressing the unwanted values.

Cheers!
 
The easiest way would be to make sure your data is sorted by sequence number first (Crystal can do this, but it's best to offload sorting to the database where possible).

Then go to Report > Group Expert and add a grouping on the sequence number. Once you've done this you'll notice in your report you have new groups, GHX and GFX where X is the group number (if you only have one group it'll be GH1 and GF1).

If you insert the fields you want in the group footer for the sequence number it'll always be the last entry. Similarly, insert the fields you want into the group header and it'll be the first entry.

When adding a group you'll also get a details level which is designed to show the details of each entry in the group (each sequence number). If you don't require that, just right click it and choose suppress.
 
Back
Top Bottom