IanWaterman
Programmer
Please help, I posted this as "Build an Index" the other day and got no replies. Can someone at least comment on what I am doing wrong, or tell me that what I am trying to do is impossible.
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]:="General Information"
//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
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]:="General Information"
//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