Build Index Page in Report Footer
Build Index Page in Report Footer
(OP)
Hello,
I am using Crystal Reports 2013.
I have a SQL table that looks like this with thousands of records.

My report groups by and does a page break on Dept. There are many pages per Dept. The current report (mainframe COBOL) I am converting, has an index page at the end that shows each Dept analyst the page number where their fuel charges begin and end.
Is there a way to do this in Crystal Reports?
Thanks in advance for any assistance you can provide.
TimothyP
I am using Crystal Reports 2013.
I have a SQL table that looks like this with thousands of records.

My report groups by and does a page break on Dept. There are many pages per Dept. The current report (mainframe COBOL) I am converting, has an index page at the end that shows each Dept analyst the page number where their fuel charges begin and end.
Is there a way to do this in Crystal Reports?
Thanks in advance for any assistance you can provide.
TimothyP
RE: Build Index Page in Report Footer
-LB
RE: Build Index Page in Report Footer
TimothyP
RE: Build Index Page in Report Footer
//{@start} to be placed in the department group header:
whileprintingrecords;
stringvar array dept;
numbervar array spg;
numbervar i := i + 1;
if i <= 30 then (
redim preserve dept[i];
redim preserve spg[i];
if onfirstrecord or
{table.dept}<>previous({table.dept}) then
(
dept[i] := {table.dept};
spg[i] := pagenumber
));
//{@end} to be placed in the department group footer:
whileprintingrecords;
stringvar array dept;
numbervar array spg;
numbervar array endpg;
numbervar j := j + 1;
stringvar z;
if j <= 30 then (
redim preserve endpg[j];
if onlastrecord or
{table.dept}<>next({table.dept}) then
endpg[j] := pagenumber
);
z := z + dept[j]+": "+totext(spg[j],0,"")+" - "+totext(endpg[j],0,"")+chr(13)
//{@display index} to be placed in the report footer and formatted to "can grow":
whileprintingrecords;
stringvar z;
-LB
RE: Build Index Page in Report Footer
Works like a champ. Thank you!
TP