SSPrint Function
Applies To
fpSpread DLL control
Description
Prints the sheet.
Syntax
BOOL SSPrint(HWND hWnd, LPCTSTR lpszPrintJobName, LPSS_PRINTFORMAT lpPrintFormat, SS_PRINTFUNC lpfnPrintProc, LONG lAppData, ABORTPROC lpfnAbortProc);
BOOL TSpread::Print(LPCTSTR lpszPrintJobName, LPSS_PRINTFORMAT lpPrintFormat, SS_PRINTFUNC lpfnPrintProc, LONG lAppData, ABORTPROC lpfnAbortProc);
Parameters
The following parameters are available:
Parameter | Description |
---|---|
hWnd | Window handle of the fpSpread control |
lpszPrintJobName | Text displayed in the Print Manager |
lpPrintFormat | Pointer to SS_PRINTFORMAT structure You can set this to NULL and call the SSGetPrintOptions function to return the default format values. |
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 |
lpfnAbortProc | Optional AbortProc callback function (Refer to the AbortProc callback prototype in the Remarks section. Use this function to display a cancel dialog box.) |
Remarks
You can control what data is printed and the format of the printed data.The SS_PRINTFORMAT structure specifies the formatting parameters. Display a dialog box to query the user for the formatting parameters, then populate the SS_PRINTFORMAT structure and print the sheet.
Calling the SSPrint function prints either the active sheet or a specified sheet. To specify a sheet, call the SSSetSheet function before calling the SSPrint function.
The following prototype is used for the lpfnPrintProc callback function:
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 SSPrint function call | |
lpPrintInfo | Pointer to SS_PRINTINFO structure |
The following prototype is used for the lpfnAbortProc callback function:
short CALLBACK AbortProc(HDC hDC, short nCode);
Parameter | Description |
hDC | Printer device context handle |
nCode | Specifies if an error has occurred |
Return Value
TRUE if the function completes successfully; FALSE otherwise.
See Also
Adding Header and Footer Text to Printed Pages
Printing the Portion of the Sheet with Data
Sending a Sheet to a Printer
Specifying a Print Range
Specifying Print Options
SSGetPrintOptions, SSSetPrintOptions, SSSetSheet functions
SS_PRINTFORMAT, SS_PRINTINFO structure
ActiveX Correspondence
hDCPrinter, PrintAbortMsg, PrintBorder, PrintColHeaders, PrintColor, PrintFooter, PrintGrid, PrintHeader, PrintJobName, PrintMarginBottom, PrintMarginLeft, PrintMarginRight, PrintMarginTop, PrintPageEnd, PrintPageStart, PrintRowHeaders, PrintShadows, PrintType, PrintUseDataMax properties
PrintSheet method