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

Accessing the Windows Default Printer from SQR



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