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!

Build an Index

Status
Not open for further replies.

IanWaterman

Programmer
Jun 26, 2002
3,511
GB
I am not using groups so I can not use the CrystalDecisions solution, however, i have adapted and it almost works.

The report was designed by someoneelse and they have just presented info in details sections (about 30). Most sections run subreports, but a couple of sections collect data from the main report.

I am building a dynamic array using 3 formulas (below)inserted in each detail section(all are different but have a similar structure to those below) which move the array count on by 1 each time, check page number and manually insert title of text box from each section.


whileprintingrecords;
//a counter that will be used to determine array position
if {@fCheckLatest} = 'No' then global numbervar counter1:=counter1 else
counter1:=counter1 + 1;

//whileprintingrecords;
evaluateafter({@ArrayPosition-Gen}); //to ensure stability of the formula this should run after the counter formula
//referencing the variables declared in the report header a
shared numbervar array PageNumberArray;
global numbervar counter1;
if {@fCheckLatest} <> 'No' then PageNumberArray[counter1]:=pagenumber;
//this is where the current pagenumber is stored at the array position of the counter

whileprintingrecords;
evaluateafter({@ArrayPosition-Gen}); //to ensure stability of the formula this should run after the counter formula
//referencing the variables declared in the report header a
shared stringvar array CoverNameArray;
global numbervar counter1;
if {@fCheckLatest} <> 'No' then CoverNameArray[counter1]:=&quot;General Information&quot;
//this is where the current pagenumber is stored at the array position of the counter


The formulas appear to work perfectly, in tests I show values on relevant sections and all is OK. However, when I show contents of the Array at the end of the report, the pagenumber for the sections containing subreports are OK, however, for the sections of the main report the page numbers have been overwritten.

It seems that the first parse which is what is displayed on screen, the page produces correct data, but I am guessing when the subreports are run in the second parse, the main report data pagenumbers are generated again and then updated with the page number of the location of the first subreport.

Any ideas on how I can stop this from happening.

Ian
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top