Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

SEND PARAMETERS TO SYS(1037) OR GETPRINTER() 2

Status
Not open for further replies.

venado

Programmer
Nov 28, 2000
35
0
0
CA
I HAVE SOME REPORTS CODE INSIDE A PROCEDURE WHICH I PRINT ACCORDING TO CERTAINS CONDITION. THE REPORTS ARE PRINTED IN DIFFERENT PRINTERS. NOW, HOW CAN I SEND A PARAMETER TO EITHER =SYS(1037) OR GETPRINTER() FUNCTIONS? INSTEAD OF ASKING THE USER TO SELECT THE RIGHT PRINTER.

ANY SUGGESTION?

THANKS,CARLOS
 
venado

You could ignore SYS(1037) and GETPRINTER() and use:-

SET PRINTER TO NAME (lcName)

and send the report accordingly.

This would mean that the user would not have full control over the printer in terms of copies, print orientation etc.

The APRINTERS() function will generate a list of available printers.

Hope this helps.

Chris
 
venado

If you experience problems with the report not accepting a different printer, you can remove the printer driver information from the report with the following code.

USE reportname.frx IN 0 ALIAS TEMPREPO
SELE TEMPREPO
GO TOP
REPLACE TEMPREPO.Expr WITH [ORIENTATION=0] ,;
[tab]TEMPREPO.tag WITH [] ,;
[tab]TEMPREPO.tag2 WITH []
USE

Chris
 
1. I have a table called SYS_USER. and program startup I check the users printers with aprinters() and compair the list to the table and add deleted records as needed for the user.
2. All my report forms have been modified as per Chris's second responds.
3. When I need to print a report before I do a:
lcalias = alias()
select SYS_USER
set filter to SYS_USER.USERNAME = M.USERNAME
locate for "HP Laser" $ SYS_USER.PRINTERNAME
if !found()
goto top
endif
M.PRINTER = SYS_USER.PRINTNAME
select (lcAlias)
set printer to name (M.PRINTER)
report form .......... David W. Grewe
Dave@internationalbid.com
ICQ VFP ActiveList #46145644
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top