Hi Bill,
I got very tired of trying to justify headings (by simply guessing at how
many spaces to stick in) and took an entirely different approach. This is
written in mvBASE but you should be able to see what I did... I wrote my
own very simple screen driver, integrated it with this program, and
generated headings justified right, center and left portions and put the
options selected in the screen into the title to boot. See sample output
and program after my sig.
Damn it works slick !!! The width is set with a variable, so it will work
with any width headings as long as it's wide enough to display all the data
I got in there, like day, date, time, account, company name, report name and
options selected.
If you want to see the screen driver, I'd be happy to send the attachment
directly to you. It's a work in progress, but works. Eventually going to
expand it to a full on screen handler, and then I'm thinking of making it
public code just so people that are cheap as hello, as I am, can generate
screens for their clients without a bunch of fees.
The actual HEADING statement at the very end is really just
Z := 'HEADING ':DQ:HEADINGS:DQ
'cus all the justification has been done !!!
hth,
Allen E. Elwood
www.tortillafc.com
Quality Code Since 1978
Due to wrap around, I separated the example of the output into three
sections
(The left justified section)
MASTER.ERRORS 01:49PM
Thursday 06/22/06
(The Centered Section)
Company name, Inc.
Master Shipping Error Report
For ALL Warehouses
(The right section)
Port 34 Acct DAVE Page 1
(The program)
* General Information
* (company name withheld) - Raining Data mvBase - 05/12/2006
* MASTER.ERRORS
* Written by Allen E. Elwood www.tortillafc.com (C)2006
* in conjunction with Sysmark Information Systems, Inc.
www.sysmarkinfo.com
*
*
GOSUB GET.OPTIONS.SCREEN
GOSUB GENERATE.REPORT.STAGE1
GOSUB SETUP.HEADINGS
GOSUB GENERATE.REPORT.STAGE2
*
*===========================================================================
=====
STOP
*===========================================================================
=====
GET.OPTIONS.SCREEN:
OPEN '','WHSE' TO WHSE ELSE PRINT 'CANNOT OPEN WHSE':;STOP
*
DIM SCREEN.TEMPLATE(40)
DIM ANSWERS(40)
FN.NAME = 'Master Error Report'
PGM.NAME = 'MASTER.ERRORS'
SUCCESS = ''
NBR.OF.PROMPTS = 2
SCREEN.TEMPLATE(1) = '01 Warehouse Number or ALL
,R1_5_X|"ALL"|TRANS_WHSE_:_2_20_REQUIRED,R,MV,,ALL'
SCREEN.TEMPLATE(2) = '02 Output to CRT or Printer (C/P),"C"|"P",R,S,,C'
LOOP
CALL SUB.TFC.SCREEN(MAT SCREEN.TEMPLATE,MAT
ANSWERS,SUCCESS,FN.NAME,PGM.NAME,NBR.OF.PROMPTS)
IF SUCCESS THEN
PRINT 'Run with these options? (Y/N/END) ':;INPUT RRUN
RRUN = OCONV(RRUN,'MCU')
IF RRUN = 'Y' THEN EXIT
IF RRUN = 'END' THEN STOP
END
REPEAT
WHSES = ANSWERS(1)
DEST = ANSWERS(2)
*
*132 Screen Mode needed whether going to screen or to printer
*This cus Auxilliary printing needs it and that's how I test
CRT CHAR(27):'`;':CHAR(27):'e*'
EXECUTE "TERM 132,39"
IF DEST = 'P' THEN
EXECUTE "TERM 132,56,,,,,132,56"
END
*
RETURN
*===========================================================================
=====
GENERATE.REPORT.STAGE1:
SQ = "'"
DQ = '"'
Z = 'SORT ERRORD BY RELEASE.NO. BY ERROR.TYPE. BY PART.NBR. BY ORDER.SORT
BY LOT.NO '
*
* Setup select for whse option as well as heading text
IF WHSES # "ALL" THEN
WH.COUNT = DCOUNT(WHSES,@VM)
Z := ' AND WITH RELEASE.NO EQ '
IF WH.COUNT = 1 THEN
OPTION.TEXT = 'For Warehouse ':CHANGE(WHSES,@VM,'')
END ELSE
OPTION.TEXT = 'For Warehouses ':CHANGE(WHSES,@VM,', ')
END
FOR W = 1 TO WH.COUNT
WH = WHSES<1,W>
READV WH.ID FROM WHSE, WH, 1 ELSE
* Actually this cant happen - already verified by screen
END
Z := DQ:WH.ID:']':DQ:' '
NEXT W
END ELSE
OPTION.TEXT = 'For ALL Warehouses'
END
RETURN
*===========================================================================
=====
SETUP.HEADINGS:
RPT.HDNG = 'Master Shipping Error Report'
RPT.HDNG<2> = OPTION.TEXT
LINE.SIZE = 132
COMPANY = 'Company name withheld, Inc.'
*#* GENERIC HEADINGS DO NOT MODIFY THIS CODE
*
IF NOT(MOD(LEN(COMPANY),2)) THEN COMPANY = ' ':COMPANY
HALF.SIZE = INT(LINE.SIZE/2)
OPEN '', 'SYSTEM' TO SYSTEM ELSE STOP CANNOT OPEN SYSTEM FILE
LOGON = SYSTEM(19)
PORT = SYSTEM(18)
READ SYS.REC FROM SYSTEM, LOGON ELSE SYS.REC = ''
IF SYS.REC<1> = 'D' THEN
LOGON.ACCOUNT = LOGON
END ELSE
LOGON.ACCOUNT = SYS.REC<2>
END
*
IDATE = DATE()
TEMP = OCONV(IDATE,'DWA')
DAY = TEMP[1,1]:OCONV(TEMP[2,10],'MCL')
TIME = OCONV(TIME(),'MTH')
DATE = OCONV(IDATE,'D2/')
*
SEC.1 = PGM.NAME:' ':TIME
SEC.2 = COMPANY
SEC.3 = 'Port ':PORT:' Acct ':LOGON.ACCOUNT[40]:' Page'
L2SC1 = DAY:' ':DATE
*
SEC.1.LEN = LEN(SEC.1)
SEC.2.LEN = INT(LEN(SEC.2)/2)
SEC.3.LEN = LEN(SEC.3)+5 ; *Add five digits to account for space & page #
at eol
*
L2SC1.LEN = LEN(L2SC1)
RPT1H.LEN = INT(LEN(RPT.HDNG<1>)/2)
*
HDNG.1 = ''
HDNG.1[1,SEC.1.LEN] = SEC.1
HDNG.1[HALF.SIZE - SEC.2.LEN] = SEC.2
HDNG.1[LINE.SIZE - SEC.3.LEN] = SEC.3
*
HDNG.1 = HDNG.1[1,LINE.SIZE-5]
*
HDNG.2 = ''
HDNG.2[1,L2SC1.LEN] = L2SC1
HDNG.2[HALF.SIZE - RPT1H.LEN] = RPT.HDNG<1>
*
HDNG.3 = SPACE(HALF.SIZE-LEN(RPT.HDNG<2>)/2):RPT.HDNG<2>
HDNG.4 = SPACE(HALF.SIZE-LEN(RPT.HDNG<3>)/2):RPT.HDNG<3>
HDNG.5 = SPACE(HALF.SIZE-LEN(RPT.HDNG<4>)/2):RPT.HDNG<4>
PAGE.CNT = 0
LINE.CNT = 99
*
*#* END OF GENERIC HEADINGS
*
* Now make what would normally be headings in a program, into PICK
headings
HDNG.1 := "'":'PL':"'"
HDNG.2 := "'":'L':"'"
HDNG.3 := "'":'L':"'"
HEADINGS = HDNG.1:HDNG.2:HDNG.3
RETURN
*===========================================================================
=====
GENERATE.REPORT.STAGE2:
Z := 'BREAK-ON RELEASE.NO. CUST.NBR. CUST.NAME.FULL '
Z := 'SHIP.DATE. BREAK-ON PART.NBR. LOT.NO. ERROR.TYPE. '
Z := 'ORDERED. SHIPPED. ID.SUP '
Z := 'HEADING ':DQ:HEADINGS:DQ
IF DEST = 'P' THEN
Z := ' LPTR'
END
PERFORM Z
PRINT 'End of Job, Hit Enter to Continue':;INPUT BUBBA
PERFORM "NORM"
RETURN
-----Original Message-----
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] Behalf Of Bill Haskett
Sent: Thursday, June 22, 2006 09:33
To: [email protected]
Subject: [U2] UD: HEADING page#
I have a question regarding UD v7.1 (Windows, Pick mode):
1) Is there a little trick to get the UniQuery page # left justified?
"LIST VOC SAMPLE 5 HEADING "THIS IS PAGE: 'PL'" ...returns
THIS IS PAGE: 1
VOC.........
WIN.PCRUN2
A9
WIN.SETPARAM
LIST.LABEL
IN
5 records listed
I'm looking for the heading to look like: "THIS IS PAGE: 1". The page
number is right-justified in a field of four blanks. In D3 I need to add
the N option (e.g. "THIS IS PAGE: 'PNL'").
Thanks,
Bill
-------
u2-users mailing list
[email protected]
To unsubscribe please visit http://listserver.u2ug.org/
-------
u2-users mailing list
[email protected]
To unsubscribe please visit http://listserver.u2ug.org/