Spread 8.0 Documentation
SSGetPrintOptions, SSSetPrintOptions Functions
Support Options
DLL Reference > DLL Functions > SSGetPrintOptions, SSSetPrintOptions Functions

Glossary Item Box

SSGetPrintOptions, SSSetPrintOptions Functions


See Also

Applies To

fpSpread DLL control

Description

Set or return the print settings for the sheet.

Syntax

C

BOOL SSGetPrintOptions(HWND hWnd, LPSS_PRINTFORMAT lpPrintFormat, SS_PRINTFUNC FAR *lpfnPrintProcAddr, LPLONG lplAppData);

void SSSetPrintOptions(HWND hWnd, LPSS_PRINTFORMAT lpPrintFormat, SS_PRINTFUNC lpfnPrintProc, LONG lAppData);

C++

BOOL TSpread::GetPrintOptions(LPSS_PRINTFORMAT lpPrintFormat, SS_PRINTFUNC FAR *lpfnPrintProcAddr, LPLONG lplAppData);

void TSpread::SetPrintOptions(LPSS_PRINTFORMAT lpPrintFormat, SS_PRINTFUNC lpfnPrintProc, LONG lAppData);

Parameters

The SSGetPrintOptions function has the following parameters:

Parameter Description
hWnd Window handle of the fpSpread control
lpPrintFormat Pointer to SS_PRINTFORMAT structure
lpfnPrintProcAddr SS_PRINTFUNC callback function used for printing header and footer information
(Refer to the SS_PRINTFUNC callback prototype in the Remarks section. If no header or footer is required, use a NULL for this parameter.)
lplAppData Data passed from the SS_PRINTFUNC callback function for use by the application

The SSSetPrintOptions function has the following parameters:

Parameter Description
hWnd Window handle of the fpSpread control
lpPrintFormat Pointer to SS_PRINTFORMAT structure
lpfnPrintProc SS_PRINTFUNC callback function used for printing header and footer information
(Refer to the SS_PRINTFUNC callback prototype in the Remarks section. If no header or footer is required, use a NULL for this parameter.)
lAppData Data to be passed to the SS_PRINTFUNC callback function for use by the application

Remarks

Use LONG_PTR instead of long or LONG_PTR* instead of LPLONG for the 64-bit DLL.

Use this function to query the printer settings either for previewing the sheet in the fpSpreadPreview control or for returning the number of pages required to print the sheet using the SSGetPrintPageCount function. Use the SS_PRINTFORMAT structure to specify the formatting parameters. Display a dialog box to query the user for the formatting parameters, then populate the SS_PRINTFORMAT structure.

Calling the SSGetPrintOptions or SSSetPrintOptions function sets or returns print settings for all sheets in the book. You can set or return print settings for specific sheets by calling the SSSetSheet function before calling the SSGetPrintOptions or SSSetPrintOptions function.

The following prototype is used for the lpfnPrintProc callback function: Use LONG_PTR instead of long for the 64-bit DLL.

short CALLBACK SS_PRINTFUNC(HDC hDC, short dCommand, short nPageNum, LONG lAppData, LPSS_PRINTINFO lpPrintInfo);

Parameter Description
hDC Printer device context handle
dCommand Command to be performed
Use one of the following values:
Constant Description
SS_PRINTCMD_HEADERLEN Return header size in device units
SS_PRINTCMD_FOOTERLEN Return footer size in device units
SS_PRINTCMD_PRINTHEADER Print header
SS_PRINTCMD_PRINTFOOTER Print footer
nPageNum Current page number
lAppData Data supplied in the SSGetPrintOptions or SSSetPrintOptions function call
lpPrintInfo Pointer to SS_PRINTINFO structure

Return Value

TRUE if the function completes successfully; FALSE otherwise.

See Also

Specifying Print Options
Specifying a Print Range

SSGetPrintPageCount, SSPrint, SSSetSheet functions

SS_PRINTFORMAT, SS_PRINTINFO structures

© 2002-2014 ComponentOne, a division of GrapeCity. All Rights Reserved.