PEPrintReport Arguments

PEPrintReport is declared in CRPE.H as follows:

short FAR PASCAL PEPrintReport (
        char FAR *reportFilePath,
        BOOL toDefaultPrinter,
        BOOL toWindow, char FAR *title,
        int left, int top,
        int width, int height,
        DWORD style, HWND parentWindow);

The following table describes each argument:

Parameter Description

reportFilePath

The name of the report to be printed. Include the path if the report is not in the current directory. The report name can be hard-coded and unchangeable at runtime, or you can pass a string variable or character array as the result of a user choice.

toDefaultPrinter

If toDefaultPrinter is set to TRUE (1), the report is sent to a printer. The toWindow argument should be set to FALSE.

toWindow

If toWindow is set to TRUE (1), the report is sent to a preview window. The toDefaultPrinter argument should be set to FALSE.

title

The title that you want to appear in the window title bar. This argument can receive a string variable or a character array at runtime.

left

The position, in current screen coordinates, at which you want the left edge of the preview window to appear if the report is being printed to a window. Current screen coordinate measurements can be set within your application.

top

The position, in current screen coordinates, at which you want the top edge of the preview window to appear if the report is being printed to a window. Current screen coordinate measurements can be set within your application.

width

The width of your preview window, in current screen coordinates, if the report is being printed to a window. Current screen coordinate measurements can be set within your application.

height

The height of your preview window, in current screen coordinates, if the report is being printed to a window. Current screen coordinate measurements can be set within your application.

style

The style setting, as defined in WINDOWS.H. Style settings can be combined using the bitwise OR operator. These are standard Windows styles. Refer to Windows API documentation for complete information on window styles. Use 0 for default style settings.

parentWindow

Specifies the window handle for the parent window to be used for this preview window.

When designing a Print-Only Link using PEPrintReport, keep the following points in mind:

If the preview window is a top-level window and the window style is defined as 0 (i.e., the final two parameters in the PEPrintReport call are 0, 0) or, if the preview window is an MDI child window and the window style is defined as 0, Crystal Reports uses the following default style:

(WS_VISIBLE | WS_THICKFRAME | WS_SYSMENU | WS_MAXIMIZEBOX | 
WS_MINIMIZEBOX)

That is, the default window is a visible window with a thick frame that can be used for sizing the window. The window includes a system menu box, and maximize and minimize buttons.



Seagate Software IMG Holdings, Inc.
http://www.seagatesoftware.com
Support services:
http://support.seagatesoftware.com