How to display the total number of groups in Crystal Reports 10?

Posted on 2008-06-19
Last Modified: 2013-11-15
I have a report that collects data from a main table and several other tables with which the main table has a one-to-many relationship.  This results in several rows in the result set for each record I wish to display in my Crystal Report.  I use a group to consolidate the records into a single printed record.

Because this is a lengthy report, my client wants a "Record X of Y" counter at the bottom of the page.  The built in special field gives me just that -- the individual record count; however, I need to display Group X of Y.  Each record could span multiple pages, so Page X of Y won't do it for me, either.  I found the Group Number field (gives me X), but how can I calculate the total number of groups in the report (thus giving me Y)?  

Question by:lilfos
  • 3
  • 2
LVL 13

Expert Comment

ID: 21826000
did you try 'groupnumber' function?

Author Comment

ID: 21826177
Thanks for the quick reply.  I did, but it only got me half way there.  My report currently says:

Record {Group Number} of ????.

How do I calculate ???? ?
LVL 100

Accepted Solution

mlmcc earned 125 total points
ID: 21827349
Try this idea.  Use a formula like


Live: Real-Time Solutions, Start Here

Receive instant 1:1 support from technology experts, using our real-time conversation and whiteboard interface. Your first 5 minutes are always free.

LVL 100

Expert Comment

ID: 21827353
Do you want record number or group number?

There are special fields for record number and record count


Author Comment

ID: 21827397
I want the group count, but the client doesn't care what's going on behind the scenes.  To them, the group count is called the record count.

DistinctCount returns the same thing as Group Number.  It increments with every group.  I want to display the total number of groups from the very beginning.

Does anyone know how to display the total number of groups in a report before the report finishes displaying all the groups?

Author Comment

ID: 21827434

I just got what you meant about DistinctCount.  I was only thinking of it as a Running Total or Summary function, but it's available in the Formula Field editor, too.  When I use it there, it gives me the total distinct count of the field I'm grouping by, which effectively counts the number of groups.


Featured Post

Gigs: Get Your Project Delivered by an Expert

Select from freelancers specializing in everything from database administration to programming, who have proven themselves as experts in their field. Hire the best, collaborate easily, pay securely and get projects done right.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
Select Cross-tab total 2 62
SSRS UK Map with Postcodes 2 127
SCCM Microsoft Report 2 65
Crystal Reports 2013 25 34
Crystal Reports: 5 Tests for Top Performance It is complete, your masterpiece report.  Not only does it meet your customer’s expectations, it blows them out the water, all they want is beautifully summarised and displayed in a myriad of ways. …
Problem Statement In an SAP BI BO Integration project when a BO universe is built on a BEx query, there can be an issue of unit & formatted value objects not getting generated in a BO universe for some key figures. This results in an issue whereb…
This Micro Tutorial hows how you can integrate  Mac OSX to a Windows Active Directory Domain. Apple has made it easy to allow users to bind their macs to a windows domain with relative ease. The following video show how to bind OSX Mavericks to …
Windows 10 is mostly good. However the one thing that annoys me is how many clicks you have to do to dial a VPN connection. You have to go to settings from the start menu, (2 clicks), Network and Internet (1 click), Click VPN (another click) then fi…

785 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question