As Ken said .... it is not easy, but I have done it myself once or twice...but only when I had to.
The degree of difficulty increases with the ammount of information that you wish to display in this table, since that will govern how many formulas you will require.
You have not described your TOC so I will give you an example and the thought processes involved:
Creation and filling of arrays is the way to go as Ken pointed out...but then I sort of like the idea of a subreport that Dgillz has proposed...Perhaps we can combine the 2 ideas into one (wish I had thought of this a long time ago.)...in the past I have been using formulas to display the final data...perhaps an unlinked subreport could do it much easier.
Proposed method
===============
The creation of shared variable arrays to capture the main heading and page number where it first occurs. Then passing this information to an unlinked subreport that will simply cycle through those group headings and print the page numbers associated with them.
Formulas
@Initialization (supressed in report header)
WhilePrintingrecords;
//size of arrays 50% more than what you expect (max 1000)
Shared StringVar Array majorHeading := ["","",....,""]; Shared StringVar Array MH_Pagenumber := ["","",....,""];
numberVar MH_counter := 0;
@RecordPagenumber (suppress in the Group header of the
page that you wish to number)
WhilePrintingrecords;
Shared StringVar Array majorHeading ;
Shared StringVar Array MH_Pagenumber;
numberVar MH_counter ;
if not InRepeatedGroupHeader then
(
MH_counter := MH_counter + 1;
majorHeading [MH_counter] := {Table.MajorGroup};
MH_Pagenumber [MH_counter] := totext(pagenumber,0);
Now create a subreport with no linking to the main report. The the subreport would be structured to repeat just the major headings and descriptions associated with them
Major heading Description (optional) Page Number
{Table.MajorGroup} {Table.Description} {@FindPageNum}
{@FindPageNum}
WhilePrintingRecords;
Shared StringVar Array majorHeading ;
Shared StringVar Array MH_Pagenumber;
NumberVar iCount;
StringVar result := "";
for icount := 1 to ubound(majorHeading) do
(
if majorHeading[icount] = {Table.MajorGroup} then
(
result := MH_Pagenumber[iCount];
exit for;
);
);
Result;
Actually this seems almost too simple and is easy to impliment....I wish I had thought of this unlinked subreport (placed in the report footer) before.
You can expand on this idea to get subheadings as well.
Hope this helps
Jim
JimBroadbent@Hotmail.com