At 01:39 PM 1/28/2008, Steve Breen wrote:
Is there a way to disconnect and reconnect to a new printer.
Steve,
There is no such thing as disconnecting and then reconnecting to
a new printer.
Technically, each session of R:BASE registers the Windows default
printer as the default R:BASE session printer at startup.
You may notice the exact name of the default R:BASE session printer
on the bottom Status Bar of the Database Explorer. If you need to
change the printer, you may either use the PRNSETUP command or
simply double-click on the printer icon the status bar to select
a new printer.
In addition, if you wish, you may adapt the following routine to
pick the appropriate printer before printing the report.
Example:
-- Start here ...
-- Pick Printer and Print Report
CLEAR VAR vAvailablePrinters,vItemCount,vDefaultPrinter, +
vSelectedPrinter
SET VAR vAvailablePrinters TEXT = NULL
SET VAR vItemCount INTEGER = NULL
SET VAR vDefaultPrinter TEXT = NULL
SET VAR vAvailablePrinters = ((CVAL('Printers'))+',Screen')
SET VAR vItemCount = (ITEMCNT(.vAvailablePrinters))
SET VAR vDefaultPrinter = (CVAL('WindowsPrinter'))
SET VAR vSelectedPrinter TEXT = NULL
CLS
CHOOSE vSelectedPrinter FROM #LIST .vAvailablePrinters +
CHKBOX 1 TITLE 'Select Appropriate Printer' +
CAPTION 'Available Printers' LINES .vItemCount FORMATTED +
OPTION LIST_FONT_COLOR MAROON +
|LIST_BACK_COLOR [R234,G234,B234] +
|TITLE_FONT_COLOR MAROON +
|TITLE_BACK_COLOR [R234,G234,B234] +
|WINDOW_BACK_COLOR [R234,G234,B234] +
|TITLE_FONT_NAME VERDANA +
|TITLE_FONT_SIZE 9 +
|TITLE_BOLD ON +
|WINDOW_CAPTION +
|BUTTONS_BACK_COLOR WHITE +
|BUTTONS_SHOW_GLYPH ON +
|THEMENAME R:BASE Rocks!
IF vSelectedPrinter IS NULL OR vSelectedPrinter = '[Esc]' THEN
GOTO Done
ENDIF
IF vSelectedPrinter = 'Screen' THEN
PRINT reportname WHERE .. ORDER BY .. +
OPTION SCREEN|WINDOW_STATE MAXIMIZED +
|ZOOM_TYPE PERCENTAGE|ZOOMPERCENT 90
GOTO Done
ELSE
PRNSETUP .vSelectedPrinter
PRINT reportname WHERE .. ORDER BY .. OPTION PRINTER
PRNSETUP .vDefaultPrinter
ENDIF
LABEL Done
CLS
CLEAR VAR vAvailablePrinters,vItemCount,vDefaultPrinter, +
vSelectedPrinter
RETURN
-- End here ...
Hope that helps!
Very Best R:egards,
Razzak.