>>Well, you have to make 2 passes, but you don't have to run everything twice
>>if you save the first iteration (to memory or disk) and some sort of
>>pointers to where updates are needed
>>Then there's no need to recalculate everything twice...
>
>Thats true, but then again, what if your report has a lot of special formatting - that which cannot be stored to disk? Managing pointers, additional memvar, etc, would seem to be more work that its worth.
>
>If you have some report - with reasonably predictable results, you might be able to find a correlation between number of records and pages. I would bet this would be the exception - not the rule.
Why, Arnon's idea is quite feasible. Print to disk, and store some impossible string like ##$$## where you want the number of pages. Then just create a cursor with one memo field, append the file,
Repl file_in_memo with StrTran(File_in_memo, "##$$##","of "+str(_pageno,4,0))
and write the memo back to disk, and then send the file to print. The file may be couple of megs, depending on your printer and actual number of pages, so some LLFF approach would surely work faster, and wouldn't occupy so much resources, but the idea would basically be the same.