Previous Thread
Next Thread
Print Thread
Default printer for EZTYP/EZVUE #1398 11 Jan 08 12:56 PM
A
Anonymous
Unregistered
Anonymous
Unregistered
A
We use Ashell on Linux(Red Hat). We always display printout with EZTYP. User, then, have an option to just preview report or print it. When user decides to print it, is there a way with EZTYP to default printer so user does not have to think about printer name (and specify the wrong printer)?

I'd like to be able to specify default printer for EZTYP in my program, based on the data in report (so different reports could go to different printers, based on report, user, loc, division etc.)?

I can see, currently, that EZTYP allows only one parameter (file name). Please let me know if you have solution for this.

Thanks,
Miro

Re: Default printer for EZTYP/EZVUE #1399 11 Jan 08 01:54 PM
Joined: Jun 2001
Posts: 11,794
J
Jack McGregor Offline
Member
Offline
Member
J
Joined: Jun 2001
Posts: 11,794
One approach would be to activate the SBR=EZPRTX switch in the miame.ini. In that case, EZTYP will XCALL EZPRTX, FSPEC, SPAGE, EPAGE, STATUS at the point where it would otherwise have prompted you for the printer name. You can create your own EZPRTX.SBX and handle printer selection any way you like from that point.

It's not quite ideal for what you want because it doesn't allow you to pass a printer name from the calling program, but it works well if you can figure out the printer you want from other information at runtime (like the printfile name, user name, directory, etc.) (In fact, this could be a big advantage because it allows you to add all your printer specification logic in one place, rather than in all of your programs.

Another approach would be to use XCALL EZSPL rather than XCALL EZTYP. EZTYP is just a special case of EZSPL (with the &h80000000 bit set in the OPTIONS field). This way, you can set the printer name, which would then become the default selection when you use the P command to print.

Re: Default printer for EZTYP/EZVUE #1400 16 Jan 08 10:05 AM
A
Anonymous
Unregistered
Anonymous
Unregistered
A
Is there a chance you can give me one example of using XCALL EZSPL?

Thanks in advance

Re: Default printer for EZTYP/EZVUE #1401 16 Jan 08 01:45 PM
Joined: Jun 2001
Posts: 11,794
J
Jack McGregor Offline
Member
Offline
Member
J
Joined: Jun 2001
Posts: 11,794
Here's the source of EZTYP.LIT, with the XCALL EZTYP commented out and replace with an equivalent XCALL EZSPL. Note that in your case, you would probably want to set the PRINTER field before calling EZSPL. (That would set the default printer for the EZTYP P command).

Code
program EZTYP,1.0(100)	! Written by JDM 11-May-93

! ***************************************************************
! *								*
! *	A-Shell command program: EZTYP.LIT			*
! *								*
! *	Use EZ-SPOOL to display file on screen			*
! *								*
! ***************************************************************

! Edit history of TYPE:-

! Version 1.0:-

! 11-May-93 -	Created /JDM

! Variables used in TYPE:-

	map1 FILE$,s,220		! File spec

MAP1 EZSPL1
	MAP2 PRINTER,S,6			! Printer Name
	MAP2 CPU,F,6				! CPU address
	MAP2 SWITCHES,F,6			! Spooler switches
	MAP2 COPIES,F,6				! Number of copies
	MAP2 BANNER,S,50			! Banner Text
	MAP2 LPP,F,6				! Lines per page
	MAP2 WIDTH,F,6				! Columns per page
	MAP2 FORMS,S,6				! Form name
	MAP2 PRI,F,6				! Priority
	MAP2 ADATE,B,4				! Spool after DATE
	MAP2 ATIME,B,4				! Spool after TIME
	MAP2 RESTART,F,6			! Restart
	MAP2 START,F,6				! Start at page
	MAP2 FINISH,F,6				! Finish at page
	MAP2 LIMIT,F,6				! Limit number of formfeeds
	MAP2 OPTIONS,F,6			! EZSPL option switches
	MAP2 SEQNO,F,6				! Task Manager Seq number
	MAP2 COUNT,F,6				! Number of blocks queued
	MAP2 ITCERR,F,6				! ITC error code
	MAP2 NONITC,F,6				! Spooler error code
	MAP2 FILERR,F,6				! File error code
	MAP2 EXTOPT,F,6				! EZSPL extended options

MAP1 EZSPL2
	MAP2 SPLSEL,F,6				! Selected Printer code
	MAP2 MAXSPL,F,6				! pass: limits # of printers
						! returns: # of printers
	MAP2 ARRAY(64),X	
		MAP3 FLAG,S,1
		MAP3 LABEL,S,17
		MAP3 DEVNAM,S,6
		MAP3 PRTNAM,S,6
		MAP3 CPUNUM,F,6

! *** Main program starts here ***

	OPTIONS = &h80000000		! (2^31) turn on preview mode
	FILE$ = CMDLIN$ 		! get file from command line
	XCALL EZSPL,FILE$,EZSPL1	! launch eztyp

!!!	XCALL EZTYP,FILE$		
     END


  

Re: Default printer for EZTYP/EZVUE #1402 30 Apr 08 11:54 AM
A
Anonymous
Unregistered
Anonymous
Unregistered
A
Thanks Jack.
I will test this.
Another question: when user does not specify printer in EZTYP (leaves printer blank) where does print file goes (to what queue)?

Re: Default printer for EZTYP/EZVUE #1403 30 Apr 08 12:41 PM
Joined: Jun 2001
Posts: 11,794
J
Jack McGregor Offline
Member
Offline
Member
J
Joined: Jun 2001
Posts: 11,794
If no EZ-SPOOL configuration file is found, it will use the default defined by the PRINTER statement in the miame.ini. But you could create a number of EZ-SPOOL configuration files based on the search path/naming convention:

EZ:.SFL
EZ:.SPG
EZ:.SPR
EZ:.SPL
MEM:SYSTEM.SPL
SYSTEM.SPL[p,pn]
SYSTEM.SPL[p,0]
EZ:SYSTEM.SPL

Within the appropriate configuration file, you could use the PRINTER statement to assign the default printer, and one or more PRTSPL statements to define printers that would be available to TAB through. For example:

PRINTER=PDFX
PRTSPL=PDFX,Output to PDF
PRTSPL=LASER,Main laser draft printer

See the topic EZ-SPOOL in the Setup Guide for details.

Also note that another approach would be to use XCALL SPOOL, but set up your EZ-SPOOL configuration files to prompt whether she wants to preview the file and/or print it. (Using the ASKPRT=ON and TYPE=ON parameters, with or without the MENU option). The main advantage of that approach is that you can make it default to print (based on timing out or having the operator just hit ENTER a couple of times), whereas in EZTYP, they have to know enough to use the P command to print.

Re: Default printer for EZTYP/EZVUE #1404 13 Jan 09 11:50 AM
A
Anonymous
Unregistered
Anonymous
Unregistered
A
Thanks Jack,

XCALL EZSPL worked beautifully.


Moderated by  Jack McGregor, Ty Griffin 

Powered by UBB.threads™ PHP Forum Software 7.7.3