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

Actual Row Count Not Record Count 2

Status
Not open for further replies.

betachristopher

Programmer
Oct 25, 2006
54
0
0
US
I'm trying to get a row count using the below formula. My problem is that it only increments at the next record, but the next record isn't the next row. I am using 20 detail sections. In each section I have added the same formula. The data I am pulling is patient lab results. The client wants each lab result to appear on a separate line with the patient information repeated on each line. When I use this formula, the first 20 lines all display a line count of 1, and the next 20 lines for the next patient display a line count of 2. But I need each line to be counted distinctly. Can anyone help me?

Code:
Whileprintingrecords;
numbervar linecnt := linecnt +1
 
Just place in each section, it should evaulate 20 times for each record.

Ian
 
Thanks Ian. I have placed it in each section, but it doesn't evaluate 20 times. It only increments one time for every 20 rows.
 
Place your reset formula in the record header not in each section.

'J

CR8.5 / CRXI - Discovering the impossible
 
Detail sections don't increment normally, since they are really just a breakout of one row. You can get the count to increment for each detail section a,b,c, etc., by adding a newly named formula, one for each section, each containing the same content:

Whileprintingrecords;
numbervar linecnt := linecnt +1;

So for 20 sections, you will have 20 formulas, eg., {@cnta}, {@cntb},{@cntc}, etc.

-LB
 
You're a genius LB! I was hoping you would respond. One small problem that I'm noticing, and I don't know if there is a way around this, but some of the detail sections are suppressed when certain criteria is met. For those rows that are suppressed, they are still being counted. For example, I may get line counts of 1-17, and then it will skip to 21 because rows 18-20 were suppressed. Any ideas on getting around this?
 
Apply the reverse suppression condition to specific formula.

Whileprintingrecords;
If (suppression condtion for section is not true) then
numbervar linecnt := linecnt +1;



 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top