Partilhar via


_REPORTPREVIEW System Variable

Specifies the application used by Visual FoxPro to generate instances of a report preview user interface in order to satisfy requests from instances of the ReportListener class.

For more information on custom report previews, see Extending Report Preview Functionality

_REPORTPREVIEW = cProgramName

Parameters

  • cProgramName
    Specifies the object factory application invoked by Visual FoxPro.

    Note

    If the application is located in a directory other than the current default directory, include a path name with the program name.

Remarks

By default, _REPORTPREVIEW refers to ReportPreview.App, located in the main Visual FoxPro directory.

You can also specify an application to use in _REPORTPREVIEW using the File Locations tab in the Options dialog box. For more information, see File Locations Tab, Options Dialog Box.

The application in _REPORTPREVIEW is passed a NULL reference parameter, into which it must place an object reference to an instance of a class supporting the The Preview Container API. The application must then terminate, returning the Preview Container object reference:

pc = .NULL.
DO (_REPORTPREVIEW) WITH pc

The variable pc will now contain an object reference.

Consider the following statements:

    rl = NEWOBJECT("Reportlistener")
    rl.ListenerType = 1
    REPORT FORM customers.frx OBJECT rl

When Visual FoxPro executes these commands, it checks the Reportlistener's PreviewContainer property for a valid object reference. If it does not find one, it obtains one by calling the _REPORTPREVIEW application.

Visual FoxPro will generate an error if it does not locate an application for _REPORTPREVIEW during a report preview.

Note

When distributing report preview factory programs with your applications, you may find it convenient to explicitly set _REPORTPREVIEW in the Visual FoxPro configuration file, Config.fpw. For more information, see Including Report Files for Distribution and Setting Configuration Options at Startup.

Example

The following line of code sets the _REPORTPREVIEW system variable to the default Report Preview application:

_REPORTPREVIEW = HOME()+"ReportPreview.app"

See Also

Reference

SET REPORTBEHAVIOR Command
ReportListener Object
System Variables
System Variables Overview