The following should work if there is only one group header per page. If there are possibly more, and they have different numbers of virtual pages, then let me know.
First, make sure that your report is sorted by your crosstab column field (within the existing group).
Then create the following formula:
//{@reset} to be placed in the group header and suppressed:
whileprintingrecords;
numbervar col := 0;
stringvar x := "";
numbervar rowlabelcol := 0;
numbervar totcols := 0;
Then create a formula {@virtpgs} and place it in your detail section (you can suppress it):
whileprintingrecords;
numbervar col;
stringvar x;
numbervar rowlabelcol;
numbervar totcols;
if instr(x,{table.field}) = 0 then
(x := x + {table.field} + ", ";
col := col + 1);
rowlabelcol := -int(-col/8); //assuming 8 column instances
//and that row labels are repeated on each page
totcols := col + rowlabelcol + 1;//total column instances
//and row labels and adding 1 total column
if remainder(totcols,9) = 0 then //if columns and label
//column (9) fit on last page
(totcols/9)-1 else
truncate(totcols/9)
Then create a second formula and place it in your page footer:
whileprintingrecords;
numbervar pageno;
if pagenumber = 1 then
pageno := pagenumber else
pageno := pageno + {@virtpgs} + 1
This will print the page number of the actual page, so that page #1 will be page 1 and if there are 4 virtual pages, then page #2 would instead appear as page #6. If there are 3 virtual pages related to the actual page #2 (now #6) then page #3 will appear as page #10, etc.
This solution does not add page numbers to the virtual pages themselves, however.
-LB