I have done this same thing in the past, but have taken it a step further.  

I have a file setup that has records in it with either the user, form name
or combination of the two; and use that to setup the printer assignments
based on one of those combinations.  This allows me to assign the printer by
user, form or a form by a specific user.  

I then wrote a subroutine that saves the current printer information, reads
the user, form or specific assignment information, performs the new SETPTR
command and then passes the original and new information back to the calling
routine.  I can then send this back into the subroutine with a "reset" code
and then the subroutine will do a SETPTR with the original settings.  Works
great and keeps the code generation down.


Brad Moll
JK Consulting Services, Inc.
Phone:  (763)754-5354
Fax:  (763)463-1750


-----Original Message-----
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] On Behalf Of Brian Phillips
Sent: Tuesday, April 11, 2006 1:51 PM
To: 'jjuser ud2'; u2-users@listserver.u2ug.org
Subject: RE: [U2] [UD] Setptr

On UV I've done the following:
Save the current SETPTR parameters. Run a new SETPTR with different
parameters. Run the report. Then run SETPTR again, with the saved (original)
settings.

To save the current settings use 'capturing' (ex: execute "SETPTR" capturing
current.setptr)

Then parse the variable 'current.setptr' for the usual SETPTR settings
(margins, length, width, banners, form names, etc.). When you want to set it
back to its original settings, construct a new SETPTR command using these
saved settings, and execute. (Be sure to add "BRIEF" to the options so it
doesn't display the new settings in your application (or wrap in 'hush', or
capture to a dummy variable)).

> -----Original Message-----
> From: [EMAIL PROTECTED] 
> [mailto:[EMAIL PROTECTED] On Behalf Of jjuser ud2
> Sent: Tuesday, April 11, 2006 2:06 PM
> To: u2-users@listserver.u2ug.org
> Subject: Re: [U2] [UD] Setptr
> 
> Hey there :)  Regarding SETPTR...
> 
> I'd like to store a currently logged-in user's printer 
> settings (GETPTR?), change them for the output of a 
> report(SETPTR), and then restore them (SETPTR again?).  All 
> of my previous attempts at this have been unsuccessful -- 
> could somebody point me in the right direction, please?  I've 
> read the documentation for both and I feel like I'm missing something.
> 
> I'm also not sure if this should be on this list, or the SBS 
> list... ^_^
> 
> --JJ
> 
> On 3/24/06, [EMAIL PROTECTED] 
> <[EMAIL PROTECTED]> wrote:
> > Bill Haskett <[EMAIL PROTECTED]> wrote on 23 Mar 2006 19:46:16 
> > -0800
> >
> > > If I generate a report to _HOLD_ by using "SETPTR 0,,,,,3" can I 
> > > then send the report to another printer, say unit 2, by using 
> > > "SETPTR 2" just before I "SPOOL _HOLD_ P_....."?
> >
> > The first parameter of the SETPTR command allows a unit to be 
> > specified so that you can direct data to multiple print 
> jobs.  It does 
> > not tie a job to a specific printer.  The DEST parameter does that.
> >
> > The SPOOL command sends the job to your current printer, so 
> you would 
> > need to use the DEST parameter on a SETPTR command first to 
> select your printer.
> >
> > I use the first parameter to control print jobs in my check 
> printing 
> > routine.  I issue a SETPTR 1,... for the checks and a 
> SETPTR 2,... for 
> > the copies.  The code creates the print jobs in parallel 
> using PRINT 
> > ON 1 or PRINT ON 2 to direct the output to the appropriate job.  
> > Naturally, I use FOR PTR = 1 TO 2 ; PRINT ON PTR ; NEXT PTR 
> syntax to do most of the work.
> >
> > From TCL, if you type SETPTR with no parameters, you will see the 
> > current settings.  Here's my current output (AIX):
> >
> > Unit       0
> > Width      133
> > Length     65
> > Top margin 0
> > Bot margin 0
> > Mode       1
> >
> > Options are:
> > Noeject
> > Nfmt
> > Nhead
> > Nomessage
> > Destination 1ACCT
> > Copies 1.
> >
> > Spooler & options: lp -c -n1 -d1ACCT
> >
> > The original command was
> >
> > SETPTR 0,133,65,0,0,1,NFMT,NOEJECT,NOMESSAGE,DEST 
> 1ACCT,COPIES 1,NHEAD
> >
> > For a Hold & Suppress (Mode 3) or Hold & Print (Mode 6), I 
> typically 
> > replace NHEAD with a BANNER or BANNER UNIQUE tag to control the job 
> > name in the _HOLD_ file.
> >
> > --Tom Pellitieri
> >  Century Equipment
> >  Toledo, Ohio
> > -------
> > u2-users mailing list
> > u2-users@listserver.u2ug.org
> > To unsubscribe please visit http://listserver.u2ug.org/
> -------
> u2-users mailing list
> u2-users@listserver.u2ug.org
> To unsubscribe please visit http://listserver.u2ug.org/
-------
u2-users mailing list
u2-users@listserver.u2ug.org
To unsubscribe please visit http://listserver.u2ug.org/
-------
u2-users mailing list
u2-users@listserver.u2ug.org
To unsubscribe please visit http://listserver.u2ug.org/

Reply via email to