Compartir a través de


GetPageWidth Method

Returns page width in 960 dots per inch (dpi) during a report run.

iPageWidth = oReportListener.GetPageWidth()

Parameters

None.

Return Value

Integer data type, the width of the page in dots per inch. Between report runs, this method returns 0.

Remarks

Applies To: ReportListener Object.

This method and GetPageHeight allow a preview object or any other “participant” in the output process to interrogate the ReportListener object for the dimensions of page output, as determined by the printer settings in force for the report run. The ReportListener's PreviewContainer uses these methods when the ReportListener object calls its Show method, to determine how to display the current report's contents.

These methods provide usable values at all points in the reporting process after BeforeReport and before UnloadReport, unless you invoke continuation by using NOPAGEEJECT on your REPORT FORM command. If you use NOPAGEJECT, these methods continue to provide usable results until a REPORT FORM without NOPAGEEJECT arrives at its UnloadReport event. At other times, both methods return 0.

Note

The time period during which GetPageHeight and GetPageWidth provide usable values is determined by when the ReportListener sets up the page layout and print job. The ReportListener does not re-evaluate page layout and page dimensions between REPORT FORM commands when you use NOPAGEJECT since these report runs are part of a single print job. However, you can create classes derived from ReportListener that can handle multiple page sizes during a continued report run.

For more information about the sequence of events at the beginning and end of a report run, see Understanding Visual FoxPro Object-Assisted Reporting.

For illustrative sample code and comments about appropriate usage, see GetPageHeight Method.

See Also

Reference

ReportListener Object

PreviewContainer Property

The Preview Container API

Other Resources

Methods (Visual FoxPro)

Language Reference (Visual FoxPro)