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!

Generating sequential number 1

Status
Not open for further replies.

coderight

IS-IT--Management
Mar 1, 2004
15
0
0
US
Hi All,

I use CR 8.5 .
I need to display "line Number" column in the report which is nothing but a sequential number of the records. I used the "record number " function and generated the sequential number.

I also have a subreport attached to the main report. The sequential number starts from '1' in the subreport.

I would like the number to continue from the main report.
say for example .. if main report has 15 records ... and subreport has 5 records.. The "line number" column in subreport should start from 16.

Can anyone explain how to do this.

Thanks,
 
This will work if the subreport fires AFTER the main report:

In a section prior to running the subreport insert this formula (if the subreport is in in the report footer of the main, right click the report footer section and select insert section below, and then drag the subreport into the report footer b, and place the formula in report footer a):

whileprintingrecords;
shared numbervar MainRecordNumber := recordnumber

Then in the subreport use:

whileprintingrecords;
shared numbervar MainRecordNumber;
MainRecordNumber+recordnumber

Note that a shared variable allows for passing values back and forth between main and subreports.

-k
 
Hi K,

Thanks for the solution. It worked.I will keep in mind of shared variables. Thanks Again.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top