SAMPLE: Printing Text ReportsLast reviewed: February 15, 1996Article ID: Q69078 |
The information in this article applies to:
SUMMARYThe sample program REPMKR in the Microsoft Software Library demonstrates the code required to print a report. The report generator prints plain-text reports in monospace fonts either on a printer or in a print-preview window. The code to handle printer display contexts is encapsulated in the report generator code. The interface does not require the host program to work with printing code. NOTE: This sample was originally written for Windows 3.0. Applications targeted for Windows 3.1 should modify this sample's code to utilize the Common Dialog boxes. Download REPMKR.EXE, a self-extracting file, from the Microsoft Software Library (MSL) on the following services:
MORE INFORMATIONThe three functions of the report generator are as follows:
Function Description
-------- -----------
PrinterSetupDialog(void) Brings up the standard Printer
Setup dialog box
PrinterSelectDialog(void) Allows the user to select a printer
for use by the report generator
PrinterControl(int iCommand, Controls page layout
int iParam, LPSTR szParam)
The following is the table of specific commands:
iCommand iParam szParam
-------- ------ -------
PC_SETCOLS # of columns/page Not used
PC_SETROWS # of rows/page Not used
PC_PRINT Not used Not used
PC_CLEARALL Not used Not used
PC_ADDLINE -1 for next line, LPSTR to line of text
(n) for line # to add
PC_ADDBAR -1 for width of page LPSTR to character
(n) for bar width (NULL will print '-')
PC_SETPAGENUM Page number Not used
PC_SETHEADERn Not used LPSTR to header,
NULL will clear
PC_ADDHEADERn Not used Not used
PC_SETFOOTER1 Not used LPSTR to header,
NULL will clear
PC_ADDFOOTER1 Not used Not used
PC_STARTJOB Not used Not used
PC_ENDJOB TRUE = OK, Not used
FALSE = Abort
PC_SETTITLE Not used LPSTR to title
of print job
PC_SETPRINTMODE PC_CODE_PRINT or Not used
PC_CODE_PREVIEW
In the REPMKR archive file is a sample program BASE that demonstrates
how to use these functions.
Each header is printed on every page, unless it is set to NULL. Each footer is printed on every page, unless it is set to NULL. The title of the print job is displayed in the "printing" message box.
|
Additional reference words: 3.00 3.10 softlib REPMKR.EXE
© 1998 Microsoft Corporation. All rights reserved. Terms of Use. |