User Tools

Site Tools


prop_flushpagenumfunc.htm
Navigation:  Language Reference > App C - PROP: Runtime Properties > Complete Property List >====== PROP:FlushPageNumFunc ====== Previous pageReturn to chapter overviewNext page

A property of a REPORT that sets the callback function called during the flushing of previewed pages. This callback function returns the number of the next page to be flushed. The callback function must be a PROCEDURE that takes a single LONG parameter and returns a LONG.

To turn this on, the ADDRESS of your callback function must be assigned to PROP:FlushPageNumFunc. To turn it off, assign zero (0) to it.

When the report engine flushes report pages to a printer as a result of the execution of Report{PROP:FlushPreview}, the callback function is called to retrieve the number of the next page to be printed. The parameter passed to the callback function is the number of the last printed page, or 0 before printing of the first page. If the callback function returns a value out of the range of pages in the report, the report engine stops printing and removes all records from the preview queue.

The PROP:FlushPageNumFunc can return the same page number multiple times prior to the closing of the report. Once the report is closed the report engine removes the created metafiles.

Example:

 MAP

  PageNum (LONG), LONG

 END

CODE

OPEN (Report)

!Report processing code here

Report{PROP:FlushPageNumFunc} = ADDRESS(PageNum)

Report{PROP:FlushPreview} = TRUE

Report{PROP:FlushPageNumFunc} = 0

PageNum PROCEDURE (LONG LastPage)

CODE

IF LastPage = 0

 RETURN 1

ELSE

 RETURN LastPage + 2 ! Print odd pages only

END

prop_flushpagenumfunc.htm.txt · Last modified: 2021/04/15 15:57 (external edit)