>Hi,
>Thank for your reply, can you suggest any
>solution for this case ?
>
>Derek
Two possible solutions. If your data always look the same (no stretch with overflow, for example), then you may find out how many records fit on a page and pre-calculate number of pages.
The other way would be to do it when report is run, but this would require two passes, as I said.
In the Group footer insert a field with something like UpdatePageTotal()
the UpdatePageTotal function would be something like
if m.lFirstRun
insert into curPages values (GroupID, _pageNo)
endif
Create a cursor curPages in advance with GroupID and TotalPages fields.
the first time you run your report set lFirstRun variable to .f.
in the Page expression you would put something like
'Page ' + transform(_pageno)+ iif(vartype(m.lFirstRun) = 'L' and not m.lFirstRun, ' of '+ transform(iif(seek(GroupID,'curPages','GroupID'),curPages.TotalPages,_pageno)),'')
If it's not broken, fix it until it is.
My Blog