[Date Prev][Date Next][Thread Prev][Thread Next]
[Author Index] [Date Index] [Thread Index]
[SQR-USERS Info] [SQRUG Home Page]

Re: Accessing the Windows Default Printer from SQR



Hi Julie, my guess is your are using Maximo. 
I don't know if this will help  but the -printer:wp flag will send the output 
directly to the printer. 
We use this in conjunction with a user defined push button to print the current 
workorder from the screen to the default printer.

Regards
Wes Williams

>>> Julie Waggoner <WAGGO000@MAIL.GENMILLS.COM> 06/11 1:47 PM >>>
Is there any way to access the windows default printer from within an SQR?

I currently have a program that builds an HP-specific printer file with PCL
commands.  I am printing the .lis file directly to the printer because the
.spf file does not interpret the PCL commands correctly.  I am doing this
from within the program by first looking up a printer string that we have
hardcoded into a field in the database and then sending the file to that
printer through a DOS 'TYPE' command.  For example:

begin-select
varvalue        &printerloc
        move &printerloc to $printerloc
from dbo.maxvars
where varname = 'PRINTERDEFAULT'
end-select
...
LET $COMSPEC = getenv('COMSPEC')
LET $PRINTCMD = 'TYPE ' || $printrpt || ' > ' || $printerloc
LET $PRINTCMDCall = $COMSPEC || ' /C ' || $PRINTCMD
call system using $PRINTCMDCall #status WAIT

I would like to make this dynamic to use the user's windows default printer.
Is there any way I can do this from within the run of my SQR program?  I am
using SQR v4.1.1 for Windows with an Oracle 8 database.

Thanks,
Julie