IncludePageInOutput Method
Allows ReportListener to specify output page ranges.
? oReportListener.IncludePageInOutput(iPage)
Parameters
- iPage
Specifies the page number for which the ReportListener indicates rendering will, or will not, occur.
Return Value
Logical data type.
Returns True (.T.
) if the parameter you pass identifies a page in the current set of pages to be rendered.
Remarks
Applies To: ReportListener Object.
The native ReportListener class uses the two RANGE arguments of the REPORT FORM command to return a value for this method. These two arguments are represented in its CommandClauses member object as CommandClauses.RangeFrom and CommandClauses.RangeTo.
However, derived classes can support more finely-tuned ranges such as 1-10,16,20
and return different values from IncludePageInOutput.
Important
The native ReportListener uses this method to evaluate which pages are rendered for output results, but not which records or pages are actually processed. During a report run, all records and pages appropriate to your scope clauses are always processed, even when not all pages are included in output. This rule ensures that, even if you specify a limited page range for output, your calculated expressions, such as page numbers and summary totals, are correct.
Because the Report System needs to evaluate the full scope to provide the correct results, the ReportListener does not invoke this method on its preliminary pass if performing a multi-pass report run. However, your derived class can invoke this method at any time, to evaluate the need for its own actions during the preliminary pass. For more information, see TwoPassProcess Property.
If the user invokes printing from a report preview, using ReportListener's OnPreviewClose method, the pages that print do not necessarily match the results from IncludePageInOutput. The printed pages can be determined either by a user's changes to print range using the REPORT FORM command's PROMPT dialog box or by a dynamic change to the ReportListener's CommandClauses members provided for this purpose: PrintPageCurrent, PrintRangeFrom, and PrintRangeTo. The printed pages may be any subset of the full output page range. For more information, see CommandClauses Property.
Example
The following example shows an object derived from ReportListener evaluating whether to include a page in output using criteria specific to its class.
PROC IncludePageInOutput(nPageNo)
LOCAL lInclude
FOR EACH oRangeObject in THIS.MyRangeCollection
IF oRangeObject.Includes(nPageNo)
lInclude = .T.
EXIT
ENDIF
END FOR
RETURN lInclude
ENDPROC
See Also
Reference
ReportListener Object
OutputPageCount Property
OnPreviewClose Method