Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Crystal Syntax for Group Record Number 2

Status
Not open for further replies.

PIXFirewall

IS-IT--Management
Mar 13, 2003
14
IN
I have three columns of like this having 6 records grouped by country.
_________________________________________
No. Record No. Salesman Sales
----------------------------------------
USA
1 1 John 10
2 2 Paul 5
UK
3 1 Joseph 20
4 2 Martin 5
5 3 Joey 6
6 4 Luther 5
--------------------------------------

How can I get the group record numbers (column 2) to be built dynamically after taking into account the sorting based on country? I am using RecordNumber for first column.

Thank in advance.

 
You can do it with a running total that counts a field and resets on each group, or you can use two formulas:
[tt]
// @Init
// This goes in the Group Header.
whileprintingrecords;
numbervar lineNum := 0;
"";

// @Display
// This goes in the Details section.
whileprintingrecords;
numbervar lineNum := lineNum + 1;
[/tt]
-dave
 
Unless you are using a very old version of CR you can create a running total object and have it count any key field. Have the reset set to your group.

Ken Hamady, On-site Custom Crystal Reports Training & Consulting
Public classes and individual training.
Expert's Guide to Formulas / Tips and Tricks / Guide to Crystal in VB
- TEK2(AT)kenhamady.com
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top