Great code sample Razzak - thanks!!!!

David

David Blocker
[EMAIL PROTECTED]
781-784-1919
Fax: 781-784-1860
Cell: 339-206-0261
----- Original Message ----- 
From: "A. Razzak Memon" <[EMAIL PROTECTED]>
To: "RBG7-L Mailing List" <[email protected]>
Sent: Friday, May 06, 2005 11:29 PM
Subject: [RBG7-L] - Re: Prnsetup (was Re: Pre-Release Version of Update81)


> At 11:04 PM 5/6/2005, Bernie Lis wrote:
> 
> >So Razzak, please clarify:
> >If at the beginning of the command file you do:
> >set var DefaultPrinter = (cval('WindowsPrinter'))
> >prnsetup myprinter
> >print myreport option printer
> >then at the end of the program:
> >prnsetup .DefaultPrinter
> >
> >So where will the next print command print?
> 
> 
> Bernie,
> 
> Using the steps above, the next print command using the
> OPTION PRINTER will be directed to Windows default printer,
> unless specified by PRNSETUP printername command, again.
> 
> To automate the process, try the following technique without
> affecting the Windows default printer.
> 
> 
> -- Start
> CLEAR VAR vAvailablePrinters, vPickedPrinter, vDefaultPrinter
> SET VAR vAvailablePrinters TEXT = NULL
> SET VAR vPickedPrinter TEXT = NULL
> SET VAR vDefaultPrinter TEXT = NULL
> SET VAR vAvailablePrinters = ((CVAL('Printers'))+',Screen')
> SET VAR vDefaultPrinter = (CVAL('WindowsPrinter'))
> CLS
> CHOOSE vPickedPrinter FROM #LIST .vAvailablePrinters +
> CHKBOX 1 TITLE 'Select Appropriate Printer' +
> CAPTION 'Available Printers' FORMATTED +
> OPTION LIST_FONT_COLOR WHITE +
> |LIST_BACK_COLOR TEAL +
> |TITLE_FONT_COLOR RED +
> |TITLE_BACK_COLOR WHITE +
> |WINDOW_BACK_COLOR WHITE +
> |TITLE_FONT_NAME VERDANA +
> |TITLE_FONT_SIZE 10 +
> |TITLE_BOLD ON +
> |WINDOW_CAPTION +
> |BUTTONS_BACK_COLOR WHITE +
> |BUTTONS_SHOW_GLYPH ON
> IF vPickedPrinter IS NULL OR vPickedPrinter= '[Esc]' THEN
>      GOTO Done
> ENDIF
> IF vPickedPrinter = 'Screen' THEN
>     PRINT ReportName WHERE .. ORDER BY .. +
>     OPTION SCREEN|WINDOW_STATE MAXIMIZED
>     GOTO Done
> ELSE
>     PRNSETUP .vPickedPrinter
>     PRINT ReportName WHERE .. ORDER BY .. +
>     OPTION PRINTER
>     PRNSETUP .vDefaultPrinter
> ENDIF
> LABEL Done
> CLS
> CLEAR VAR vAvailablePrinters, vPickedPrinter, vDefaultPrinter
> RETURN
> -- End
> 
> Have fun!
> 
> Very Best R:egards,
> 
> Razzak.
> 
> 

Reply via email to