次の方法で共有


ReportListener Object

Provides object assistance to REPORT FORM and LABEL FORM commands.

ReportListener

Remarks

As the Report Engine processes your report or label data and layout, it sends information to a ReportListener object, rather than sending the output to a printer or preview device directly. The ReportListener "listens" for these instructions and handles the responsibility of evaluating and rendering the content of your report appropriately for your output device.

The ReportListener class is specifically designed for two-way communication with the Report Engine throughout the output generation process. Using a ReportListener, you can:

  • Write code for each element-rendering and band event as the report generation process moves forward through the report record scope.

  • Alter the position of layout elements being rendered, or their contents.

  • Provide feedback to the user about the report run.

  • Make requests of the report engine for page images, to be displayed on-screen or saved to disk.

  • Manage a private data session, holding information from the report or label definition table (.frx or .lbx), to investigate attributes of report objects and bands.

  • Communicate directly with the device to which the Report System renders output.

  • Investigate all the clauses of the REPORT FORM command, and alter some of these clauses dynamically.

Visual FoxPro gives you several different ways to attach a ReportListener to REPORT FORM or LABEL FORM commands:

  • Use the OBJECT clause on the command. For more information, see REPORT FORM Command.

  • Use the OBJECT TYPE <N> clause, specifying a numeric ListenerType for the type of output you would like to create. The Report Engine requests a ReportListener of the appropriate ListenerType from the Report Output Application. For more information, see ListenerType Property and Report Output Application.

  • Use SET REPORTBEHAVIOR 90 to enable object assistance on all REPORT FORM and LABEL FORM commands. For more information, see SET REPORTBEHAVIOR Command.

Using ReportListeners, you can send output to multiple output devices in one report run, and you can add output types, such as HTML, that Visual FoxPro reports do not support natively. For more information, see ReportListener Foundation Classes and Extending Reports at Run Time.

See Also

Reference

ReportListener Object Properties, Methods, and Events

Other Resources

Objects, Collections, and Classes