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

Record Counter- please help 1

Status
Not open for further replies.

kg2report

IS-IT--Management
Apr 5, 2018
25
US
I have a crystal report and would like for it to do the following:

1. For each record, it counts incrementally (ex: first record displays "1", second record displays "2" and this will go up to record 17.

2. The counter resets after 17 so each page should have 1 thru 17 and starts over again the next page.

I've tried so many formulas, but it's not working. Sometimes, it would seem like it's counting 1 thru 17, but it's skipping random numbers. For example, it would have 1 thru 17 down the line, but it's missing number 9.... so it really only has 16 per page.

Any help would be greatly appreciated.

kg
 
It sounds like you have some form of detail suppression set up in your report.

-LB
 
Hi LB.

I discovered that it's suppressing the records that are duplicates. I had the following in the details section "Suppress" no drill down:
previous ({table1.field1})=({table1.field1})

Question: how can I make the record counter NOT skip and still not list the duplicates?

Thanks.

kg
 
Change your counter formula to:

Whileprintingrecords;
Numbervar cnt;
If onfirstrecord or
{table1.field1} <> previous({table1.field1}) then
cnt := cnt + 1;

-LB

 
I have the counter formula you provided in the details section and the following formula in the report footer. When I changed the formula in the counter formula to yours, the numbers from page to page did not reset to "1." What do I need to do to make it reset to "1" and for the records to count to "17" down the line for each page?

whileprintingrecords;
numbervar x:=0

Thanks for your help on this, btw.

Kg
 
Having the reset formula in the property footer is not doing anything.

What formulas are currently limiting the records to 17? Where is the reset for the 17 count? Are you resetting per some group? If the report was previously working other than skipping some values, just change my formula by replacing “cnt” with “x” which appears to be what you are using.

-LB
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top