Getting the current page number during a report so it can be stored in a table (Reported, not reproduced)

Applies to: reported in the Clarion 6 group; the report has a hidden ReportPageNumber template control. No later version tested.

Problem as reported

While a report runs, the poster wanted the current page number so he could store it in a table. The ReportPageNumber template is on the report but hidden, because the number is not always shown.

What the thread found

  • The first reply was that this cannot be done.
  • Another poster suggested a second step: after the report is written, open each WMF file, search it for the value to index, and store the result. The page number is the entry number in the PrintQueue.
  • The original poster then wrote that there is a way: he already used PROP:TempNameFunc to rename and relocate the WMF files, and the function it points to is passed the number of the page just generated. He keeps it in a global variable and uses it elsewhere in the report.
  • The first replier answered that this will not work, and gave no reason. Both agreed that once the report has finished, you know which page things were printed on, and that looping through the WMFs is the way to build an index.

Caveats

  • The thread does not settle whether the global-variable idea gives the right page for the record being printed.
  • Nobody posted code or a test result.

Today (2026)

Not reproduced. This entry records a 2004 report; the PROP:TempNameFunc idea is the poster's own and was disputed. If you try it on a current build, please confirm or close it in the comments.

Sources: Chris M. (Jul 2004, the question and the TempNameFunc idea), Geoff B., Kevin E. (Jul 2004) in softvelocity.public.clarion6.