Article ID: 69078 - View products that this article applies to.
This article was previously published under Q69078
This article has been archived. It is offered "as is" and will no longer be updated.
The sample program REPMKR in the Microsoft Download Center 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.
The following file is available for download from the Microsoft Download Center:
Repmkr.exeFor additional information about how to download Microsoft Support files, click the following article number to view the article in the Microsoft Knowledge Base:
119591Microsoft scanned this file for viruses. Microsoft used the most current virus-detection software that was available on the date that the file was posted. The file is stored on security-enhanced servers that help to prevent any unauthorized changes to the file.
(http://support.microsoft.com/kb/119591/EN-US/ )How to Obtain Microsoft Support Files from Online Services
The three functions of the report generator are as follows:
The following is the table of specific commands:
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)
In the REPMKR archive file is a sample program BASE that demonstrates how to use these functions.
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
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.
Article ID: 69078 - Last Review: August 23, 2013 - Revision: 2.3