Previous Thread
Next Thread
Print Thread
Capturing selected AUXLOC:PROMPT printer. #32103 16 Dec 19 02:42 PM
Joined: Sep 2003
Posts: 4,158
Steve - Caliq Offline OP
Member
OP Offline
Member
Joined: Sep 2003
Posts: 4,158
Is there some way that ive miss that will capture/return the windows printer selected when used.
eg. LPT98.INI
DEVICE = AUXLOC:PROMPT:+GDI

For example I have dozen and dozen of invoice print files and like the user to choose the windows printer on the first file spooled, but some how remember that for the following XCALL spools...(with out prompting each time)..
Currently i just have one LPT98 that allow users to choose a windows printer...

Re: Capturing selected AUXLOC:PROMPT printer. [Re: Steve - Caliq] #32104 16 Dec 19 02:55 PM
Joined: Sep 2003
Posts: 4,158
Steve - Caliq Offline OP
Member
OP Offline
Member
Joined: Sep 2003
Posts: 4,158
Maybe on the lines of:

LPT98.INI
DEVICE = AUXLOC:PROMPT(DEFAULT):+GDI

and a new LPT95.INI
DEVICE=AUXLOC:LASTSELECTED

I then would spool the first to LPT98 for the user to choose the windows printer, then all remaining print files to LPT95 that uses the last selected.

...all other wonderful suggestions welcome ...

Re: Capturing selected AUXLOC:PROMPT printer. [Re: Steve - Caliq] #32105 16 Dec 19 02:56 PM
Joined: Sep 2002
Posts: 5,471
F
Frank Online Content
Member
Online Content
Member
F
Joined: Sep 2002
Posts: 5,471
Steve - i don't recall this being an option, but doesn't mean that it isnt!

Any way to issue a spool command to print all invoices at once using a wildcard? printfile$="invoice*.prt" ?

Re: Capturing selected AUXLOC:PROMPT printer. [Re: Steve - Caliq] #32106 16 Dec 19 02:59 PM
Joined: Sep 2003
Posts: 4,158
Steve - Caliq Offline OP
Member
OP Offline
Member
Joined: Sep 2003
Posts: 4,158
I cant find one either Frank... (rather spool one at a time so I can update our internal print manager as each one is printed)

Re: Capturing selected AUXLOC:PROMPT printer. [Re: Steve - Caliq] #32107 16 Dec 19 03:15 PM
Joined: Sep 2002
Posts: 5,471
F
Frank Online Content
Member
Online Content
Member
F
Joined: Sep 2002
Posts: 5,471
Haven't tested, but i wonder if spool.log would detail each file printed if adding a wildcard? If so you could update based on the contents of spool.log - on the other hand, when the printer goes offline how would you know where to pick it up?! crazy

Last edited by Frank; 16 Dec 19 03:27 PM.
Re: Capturing selected AUXLOC:PROMPT printer. [Re: Steve - Caliq] #32108 16 Dec 19 03:23 PM
Joined: Sep 2003
Posts: 4,158
Steve - Caliq Offline OP
Member
OP Offline
Member
Joined: Sep 2003
Posts: 4,158
Hi Frank, SPOOL.LOG just say's AUXLOC:PROMPT
and if anything messes up they can resubmit it from here.

Re: Capturing selected AUXLOC:PROMPT printer. [Re: Steve - Caliq] #32109 16 Dec 19 05:01 PM
Joined: Jun 2001
Posts: 11,794
J
Jack McGregor Offline
Member
Offline
Member
J
Joined: Jun 2001
Posts: 11,794
To confirm your comments about OPR:SPOOL.LOG, it only shows the perspective from the UNIX side, which as noted, in this case is simply the fact that we sent it to the AUXLOC:PROMPT device.

It may be small consolation, but ATE will remember the printer selection, so after the user selects a printer, the subsequent print requests will at least default to the previously selected printer, although they still have to click to dismiss the selection dialog. (In the case of APEX, it will use the previously selected printer as the context for the next APEX preview, even without prompting, but then the user would have to click to print.)

It does seem reasonable to define a special printer name as you suggest, i.e. LASTSELECT, or DEFAULT, to turn off the selection dialog (since an empty printer name will automatically use the one in the ATE configuration printer options).

Let me investigate that further and get back to you.

Re: Capturing selected AUXLOC:PROMPT printer. [Re: Steve - Caliq] #32110 16 Dec 19 05:02 PM
Joined: Sep 2003
Posts: 4,158
Steve - Caliq Offline OP
Member
OP Offline
Member
Joined: Sep 2003
Posts: 4,158
Thankyou!

Re: Capturing selected AUXLOC:PROMPT printer. [Re: Steve - Caliq] #32111 17 Dec 19 05:59 AM
Joined: Jun 2001
Posts: 11,794
J
Jack McGregor Offline
Member
Offline
Member
J
Joined: Jun 2001
Posts: 11,794
Ok, I've made a pass at this, using the pseudo device LASTPROMPT:
As with PROMPT: it can be combined with AUXLOC:.
Note that it needs the trailing colon, lest it be treated like an ordinary printer init file name.
Also note that as with the pseudo-device PROMPT: it automatically defaults to GDI (PASSTHROUGH=OFF) mode.

If you're feeling brave, here's a beta release ...

ash-6.5.1673.0-w32-upd.zip
ash65notes.txt

Re: Capturing selected AUXLOC:PROMPT printer. [Re: Steve - Caliq] #32112 17 Dec 19 09:58 AM
Joined: Sep 2003
Posts: 4,158
Steve - Caliq Offline OP
Member
OP Offline
Member
Joined: Sep 2003
Posts: 4,158
Thanks Jack..

I set up the following two print INI files...

.TYPE SYS:LPT98.INI
Code
DEVICE = AUXLOC:PROMPT(DEFAULT):+GDI


.TYPE SYS:LPT97.INI
Code
DEVICE=AUXLOC:LASTPROMPT:



Printed a test text file to LPT98 and it asked which Windows printer as desired.

Code
.PRINT LPT98=STEVE.PRT
STEVE.PRT
Total of 1 file submitted, 1 disk block


Then printed same test text file to LPT97 and it skipped any printer dialog and printed to my previous selected Windows printer , again just as desired. smile

Code
PRINT LPT97=STEVE.PRT
STEVE.PRT
Total of 1 file submitted, 1 disk block


Both show this in my spool.log
.TYPE OPR:SPOOL.LOG
Code
17-Dec-19 09:30:28 J=TSKAAE P=PRINT U=steve T=pts/2:9684 F=/inhouse/miame/dsk43/241551/steve.prt Q=LPT98 C=1/1 S=262144
AUXLOC:PROMPT(DEFAULT):+GDI
17-Dec-19 09:31:13 J=TSKAAE P=PRINT U=steve T=pts/2:9684 F=/inhouse/miame/dsk43/241551/steve.prt Q=LPT97 C=1/1 S=262144
AUXLOC:LASTPROMPT:



This was all at the dot prompt, but when use XCALL SPOOL to print to LPT97 it still pops up the printer dialog and does not even update spool.log as LPT98 does:
Code
17-Dec-19 09:43:04 J=TSKAAE P=MADPMG U=steve T=pts/2:9684 F=/inhouse/miame/dsk43
/241017/c02515.lpf Q=LPT98 C=1/1 S=262506
AUXLOC:PROMPT(DEFAULT):+GDI


Before I go digging would XCALL SPOOL work different to PRINT at the dot prompt?
Running Linux/6.5.1664.4 server end.


Last edited by Steve - Caliq; 17 Dec 19 09:58 AM.
Re: Capturing selected AUXLOC:PROMPT printer. [Re: Steve - Caliq] #32113 17 Dec 19 04:02 PM
Joined: Jun 2001
Posts: 11,794
J
Jack McGregor Offline
Member
Offline
Member
J
Joined: Jun 2001
Posts: 11,794
My initial thought is that the process is the same whether you use PRINT.LIT (which internally uses XCALL EZSPL) or you use XCALL SPOOL (which also internally redirects to XCALL EZSPL). But, (or because of that), I only tested it with PRINT.LIT, but I did test with both printer init files and with using the pseudo-device name directly in the print statement (e.g. .PRINT LASTPROMPT:=test.prt).

Let me do a bit more testing...

Re: Capturing selected AUXLOC:PROMPT printer. [Re: Steve - Caliq] #32114 17 Dec 19 04:07 PM
Joined: Sep 2003
Posts: 4,158
Steve - Caliq Offline OP
Member
OP Offline
Member
Joined: Sep 2003
Posts: 4,158
OK...Ta.

Re: Capturing selected AUXLOC:PROMPT printer. [Re: Steve - Caliq] #32115 17 Dec 19 05:59 PM
Joined: Jun 2001
Posts: 11,794
J
Jack McGregor Offline
Member
Offline
Member
J
Joined: Jun 2001
Posts: 11,794
Ok, I'm not succeeding in reproducing the problem. Here's my test environment:

ATE 6.5.1673.0, connecting to A-Shell/Linux 6.5.1671.0 (server version shouldn't matter here)

I set up two printer init files:

Code
.TYPE ASHCFG:AUXPRM.PQI
DEVICE=AUXLOC:PROMPT:

.TYPE ASHCFG:AUXLP.PQI
DEVICE=AUXLOC:LASTPROMPT:


Test program:
Code
? "Printing this file to PROMPT: " ...
xcall SPOOL, "HELLO1.TXT", "AUXPRM"

? "Printing this file to LASTPROMPT: " ...
xcall SPOOL, "HELLO2.TXT", "AUXLP"

END


Seems to work as expected, i.e. the first one prompts for the printer, and the second one prints directly to that same printer. And the entries in the log as expected ...

Code
17-Dec-19 11:47:33 J=TSKACT P=TSTP2 U=jackmc T=pts/58:3737 F=/u2/miame/back9/150501/hello1.txt Q=AUXPRM C=1/1 S=262144
AUXLOC:PROMPT:
17-Dec-19 11:47:44 J=TSKACT P=TSTP2 U=jackmc T=pts/58:3737 F=/u2/miame/back9/150501/hello2.txt Q=AUXLP C=1/1 S=262144
AUXLOC:LASTPROMPT:


I suggest we examine your XCALL SPOOL statement more closely, as it certainly appears that there might be something amiss there.

A few thoughts to consider:

  • If you try to print to a Windows printer that doesn't exist, ATE or A-Shell/Windows will launch the printer selection dialog, so at least in the Windows environment, your symptoms might suggest a typo in the printer name.
  • But since this is ATE, if no printer init file was found, it would assume that you were talking about a Linux spooler, and it wouldn't get forwarded to ATE and you wouldn't see the selection dialog, so that doesn't quite make sense.
  • This logic should work the same on a local Windows workstation -- just remove the AUXLOC: stuff --, so that might be an easier environment to start the test in.)
  • Additional complications that could confuse matters, especially in the ATE environment: EZSPL configuration options and APEX. (I had to create a EZ:TSTP2.SPG file with MENU=OFF and ASKPRT=OFF to get EZSPL to leave my test alone, and I had to set the APEX Preview Preferences to OFF so that it didn't get in the middle of things as well.)
  • SET TRACE LP ON and SET TRACE XCALL ON might be of some help on the server side to confirm that the xcall and print requests are proceeding along the expected path.

Re: Capturing selected AUXLOC:PROMPT printer. [Re: Steve - Caliq] #32116 17 Dec 19 11:10 PM
Joined: Sep 2003
Posts: 4,158
Steve - Caliq Offline OP
Member
OP Offline
Member
Joined: Sep 2003
Posts: 4,158
Thanks , I’ll go digging tomorrow and try spot a reason or a difference using your test program with xcall spool...

Re: Capturing selected AUXLOC:PROMPT printer. [Re: Steve - Caliq] #32117 18 Dec 19 09:47 AM
Joined: Sep 2003
Posts: 4,158
Steve - Caliq Offline OP
Member
OP Offline
Member
Joined: Sep 2003
Posts: 4,158
Morning...
Jack your test code work wonderful here too..
So after a bit of digging I found our test system had in the distance past had already a LPT97 printer setup in the Madics printer table but being very unlucky it was set to use the very old style TAB(-1,82) Enter transparent print mode so printing to it looked as it was using my LPT98.INI displaying the windows printer dialog. Deleting that and now everything is working as expected smile Thankyou...

Re: Capturing selected AUXLOC:PROMPT printer. [Re: Steve - Caliq] #32118 18 Dec 19 11:24 AM
Joined: Sep 2003
Posts: 4,158
Steve - Caliq Offline OP
Member
OP Offline
Member
Joined: Sep 2003
Posts: 4,158
would it be possible at a convenient moment to have a new full ATE install/build/setup... so i can roll it out.. Thanks.

Re: Capturing selected AUXLOC:PROMPT printer. [Re: Steve - Caliq] #32119 18 Dec 19 04:53 PM
Joined: Jun 2001
Posts: 11,794
J
Jack McGregor Offline
Member
Offline
Member
J
Joined: Jun 2001
Posts: 11,794
Well, I have to say I'm a bit shocked (but also somewhat relieved) to find that I'm not the only one capable of such mistakes!

Your installer update should be ready to download, either manually or via the Help > Check for Updates.

Re: Capturing selected AUXLOC:PROMPT printer. [Re: Steve - Caliq] #32120 18 Dec 19 05:08 PM
Joined: Sep 2003
Posts: 4,158
Steve - Caliq Offline OP
Member
OP Offline
Member
Joined: Sep 2003
Posts: 4,158
Amazing how things 20+ years ago still bite us in the bum...
Thanks for the install.. smile


Moderated by  Jack McGregor, Ty Griffin 

Powered by UBB.threads™ PHP Forum Software 7.7.3