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 Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Counter Question

Status
Not open for further replies.

dunkyn

Technical User
Apr 30, 2001
194
US
I have four detail sections.

I want to have a counter that counts them 1,2,3,4...

My formula always returns a 1.

Here it is:

WhilePrintingRecords;
NumberVar counter;
counter:=Counter+1;

Any suggestions?

TIA
 
On Crystal 8.5, it's much easier to use Running Totals for that sort of count.

Madawc Williams
East Anglia, Great Britain
 
Where's your formula?

You'd need it in each detail section to continue incrementing.

And where is it used?

If you're displaying at the details level, use the following in each:

WhilePrintingRecords;
NumberVar counter;
counter:=Counter+1;
counter

If you have other requirements, please state them in their entirety.

-k
 
Since each detail section (a - d) is referring to the same row of data or recordnumber, I think the only way to count them individually, e.g., detail_a = 1, detail_b = 2, etc., is to hard code the numbers, i.e., to add a text box containing the number into each section--but there's probably not much point in this. If you want to get a count across a series of detail sections, lets' say a - d, you could change the formula to:

WhilePrintingRecords;
NumberVar counter;
counter:=Counter+4;
counter;

This will give you for records 1 - 3:

4
4
4
4
8
8
8
8
12
12
12
12 //etc.

...which would be accurate on the last detail section for each recordnumber.

-LB
 
Maybe I am missing something, but if you have 4 detail sections (like Details A, Details B, etc) you could simply put 4 text objects in that said 1, 2, 3, and 4.

If what you really have is 4 records then you can use a running total or the special field "recordNumber" - depending on if you need a reset for each set of 4.

Ken Hamady, On-site Custom Crystal Reports Training & Consulting
Public classes and individual training.
Expert's Guide to Formulas / Guide to Crystal in VB
- tek@kenhamady.com
 
Thank you all for the input.

I really need to back up and set up a database in Access that will allow all of the detail information to come from one field...so I can graph on it.

I was trying to create a work around, since there are only four field for two categories, but all of the field names in the detail section are different and so I cannot graph it.

Let me try a different database setup and I'll come back to you.

thx.

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top