-- getprinter.sql    Get Printer Specification                 by bknox@uaex.edu

--**Use this information and these scripts at your own risk. As a condition of using these scripts and information from this site, you agree to hold harmless both the University of Arkansas Cooperative Extension Service and Bruce Knox for any problems that they may cause or other situations that may arise from their use, and that neither the Extension Service nor I will be held liable for those consequences. The scripts and information are provided "as is" without warranty, implied or otherwise. Limitation of liability will be the amount paid to the University of Arkansas specifically for this information. (It was free:) 

-- this file is never executed directly.  It is input to sed which creates a START file
-- specific to the calling (report) program.

-- Get Printer Specification for this USER id

-- this specification is intended for reports to be read by WordPad, WP, Word, etc.

-- if the name on line one is not equal to the UNIX filename, 
-- then this code was created programmatically
-- see the original getprinter.sql file

-- see the SQL*Plus program report_skeleton.sql for the placement of calling program 
-- statements required to use getprinter.sql
 
-- this method depends upon a file created for each user (see printer_bknox.sql)
-- this file holds the current printer specification for that user and determines 
-- the number of lines on a page
-- reference GTVPRNT for the printer control string set up in Banner for that printer 
-- (should you wish to print directly)

-- bknox@uaex.edu 4-29-99 created

SET SHOWMODE OFF
SET ECHO OFF
SET TERMOUT OFF
SET NEWPAGE 1
SET PAGESIZE 51
SET LINESIZE 256
SET TRIMSPOOL ON
SET TIMING OFF
SET TIME OFF
SET HEADING OFF
SET FEEDBACK OFF
SET VERIFY OFF
SET TTITLE OFF
SET BTITLE OFF

-- Set Default Printer Definitions

DEFINE prnt_code = 'hp4000'
DEFINE prnt_form = 'LANDSCAPE'
DEFINE line_count = 51
DEFINE prnt_margin = .25

SET PAGESIZE &&line_count

!rm -f string.prt

SPOOL string.prt

SELECT 'START '||'printer_'|| LOWER(USER) ||'.sql' FROM DUAL;

SPOOL OFF


START string.prt      -- if not found Defaults will be used

!rm -f string.prt

-- This script is available "as is".  See Disclaimer http://www.uaex.edu/bknox/