task in two different ways, #1 is to call the print dialog and define printing settings
manually:
Code:
'Print Using the Printing dialog for confirming configuration. CALL EGP_PrintDialog(CB.HNDL, HGrid, "Page 1", "Printing Test", "")
execute the code like this:
Code:
' Print manually, no dialog. LOCAL HDocument AS LONG LOCAL PrintFlags AS LONG ' Select what you want to print. ' Note: You can read the last configuration saved by Default dialog ' reading the registry values at: HKEY_CURRENT_USER\Software\SweetHeartGames\PrintEngine PrintFlags = %EGP_HORZGRIDLINES OR %EGP_VERTGRIDLINES OR %EGP_HORZMARGINLINES OR %EGP_VERTMARGINLINES OR _ %EGP_PRINTBACKGROUND OR %EGP_BACKGROUNDCOLOR OR %EGP_PRINTCONTROLS OR %EGP_TEXT OR %EGP_PRINTBITMAPS ' Make Sure a printer is installed IF ISFALSE(LEN(EGP_GetDefaultPrinter())) THEN MSGBOX " No printers are installed.", %MB_ICONERROR OR %MB_OK, "Unable to print" EXIT FUNCTION END IF ' Create Document. HDocument = EGP_CreateDocument(CBHNDL, EGP_GetDefaultPrinter(), "Egrid32 Printing example - Page 1", "", %EGP_PRINT OR %EGP_PORTRAIT) ' You can also use %EGP_LANDSCAPE ' Create a page. Result = EGP_CreatePage(HDocument, "Page #1") 'Print Egrid32's page 1 in current Printing Page. EGP_PrintGrid(HDocument, HGrid, 1, 1, PrintFlags, "") ' Finish Page, Document, and print it. EGP_PrintAndClose(HDocument, "")

Leave a comment: