Focal Point
How to align Subtotals in Subfoot with the column

This topic can be found at:
https://forums.informationbuilders.com/eve/forums/a/tpc/f/7971057331/m/1881077331

April 28, 2004, 10:09 PM
<Vipul>
How to align Subtotals in Subfoot with the column
All, Please help me.

I need to align the subtotals displayed in subfoot of the report. I am doing this because I also need to display count of the counter in the same row. My code is as given below:
-* File cartotal.fex
-SET ECHO=ALL;
-RUN
-*TO DISPLAY THE SQLS GENERATED
SET MSG=ON
SET EMPTYREPORT = ON
SET ASNAMES = ON
SET AUTOINDEX = ON
SET CARTESIAN = OFF
SET CENT-ZERO = OFF
SET DEFINES = COMPILED
SET LINES=999999
SET PRINTPLUS = ON
-*SET ORIENTATION=LANDSCAPE
SET NODATA=0
-SET MISSING = OFF;
-*SET OFFLINE-FMT = STYLED
SET PAGE-NUM = NOLEAD
-********************************
DEFINE FILE CAR
SP/A1 = HEXBYT(160, 'A1');
SP02/A2 = SP|SP;
SP05/A05 = SP|SP|SP|SP|SP;
SP10/A10 = SP05|SP05;
SP15/A15 = SP10|SP05;
SP20/A20 = SP10|SP10;
SP35/A35 = SP10|SP10|SP10|SP05;
CNT/I6 = 1;
PAIDCOST/P17.2CM = RETAIL_COST ;
END
TABLE FILE CAR
PRINT CNT NOPRINT
COUNTRY AS 'Country'
MODEL AS 'Model'
PAIDCOST AS 'Retail Cost'
BY COUNTRY NOPRINT
BY HIGHEST PAIDCOST NOPRINT
ON COUNTRY SUBFOOT
"Totals: .lt.SP35 .lt.ST.CNT .lt.SP35 .lt.ST.PAIDCOST "
HEADING
"Account .lt.COUNTRY "
ON TABLE SET STYLE *
TYPE=REPORT, GRID=OFF, $
ENDSTYLE
END
-RUN

Any Solutions, ideas. Thanks in advance.

Vipul
April 28, 2004, 10:20 PM
<ron>
Looks like all you need are some spot markers. You will still have to count bytes to know where to embed them. For example:

"Totals: <20 .lt.SP35 <30 .lt.ST.CNT <40 .lt.SP35 <50 .lt.ST.PAIDCOST "
April 28, 2004, 10:28 PM
<Vipul>
That does not work to align the amount field as the field position changes with its value.

for example
Country-------Amount
England--------10.00
England-------100.00
Total--------110.00

France---------10.00
France--------100.00
France--------900.00
Total--------1000.00

Spot markers do not align the Totals exactly.

Vipul
April 29, 2004, 07:53 AM
<Grzegorz>
Vipul,

Try:

-* ...
ON COUNTRY SUBFOOT
"Totals:-* ...
ON TABLE SET STYLE *
-* ...
TYPE=REPORT, GRID=ON,$
TYPE=SUBFOOT, HEADALIGN=BODY,$
-* ...
ENDSTYLE
In order to test the HEADALIGN options, it is more convenient to use GRID=ON in stylesheets - after the testing is finished you can switch to GRID=OFF.

Hope this helps
Grzegorz

This message has been edited. Last edited by: <Mabel>,
April 29, 2004, 02:10 PM
<Vipul>
Thanks for the help BUT I still do not get what I want...I am posting the snippet and will explain what I am getting:
TABLE FILE PD_INFO
PRINT CNT NOPRINT
WHERE BNKACCTKY = &BNKACCTKY
IF RECORDLIMIT EQ 1
END
-IF &LINES EQ 0 THEN GOTO ERRCREDIT;

TABLE FILE PD_INFO
PRINT
CNT NOPRINT
PAIDDATE AS 'Date Paid'
CUSTREF AS 'Check Number'
PAIDAMOUNT AS 'Check Amount'
FITRNREF AS 'Sequence Number'
BNKACCTKY NOPRINT
BY BNKACCTKY NOPRINT
BY HIGHEST AMOUNT NOPRINT
WHERE BNKACCTKY = &BNKACCTKY
ON BNKACCTKY SUBFOOT
"Totals: .lt.ST.CNT .lt.PAIDAMOUNT "
HEADING
"Account .lt.BNKACCTKY "
ON TABLE NOTOTAL
-********REPORT FORMAT*******************
ON TABLE HOLD AS PYDYCBO2 FORMAT HTMTABLE
-*ON TABLE PCHOLD FORMAT &FORMAT
-*****************************************
ON TABLE SET STYLE *
TYPE=REPORT, GRID=ON, STYLE=NORMAL, FONT='&RFONT', SIZE=&RSIZE,
BACKCOLOR=NONE,$
TYPE=SUBFOOT, HEADALIGN = BODY, SQUEEZE=ON, $
TYPE=SUBFOOT, LINE=1, CLASS=bborder, $
TYPE=SUBFOOT, LINE=1, ITEM=3, JUSTIFY=LEFT, CLASS=bborder, $
TYPE=HEADING, LINE=1, SIZE=9, STYLE=BOLD, BACKCOLOR=RGB(&STYLE2), $
TYPE=TITLE,STYLE=-UNDERLINE, $
TYPE=TITLE,
COLUMN=N6,
JUSTIFY=LEFT,
FOCEXEC=pdchks(\
SORTFLD='CUSTREF' \
SORTDIR='&SORTDIR' \
),
$
TYPE=TITLE,
COLUMN=N7,
JUSTIFY=RIGHT,
FOCEXEC=pdchks(\
SORTFLD='PAIDAMOUNT' \
SORTDIR='&SORTDIR' \
),
$
ENDSTYLE
END
-RUN
-GOTO HTMLFORM

In the following stmt
Totals: .lt.ST.CNT .lt.PAIDAMOUNT

the paidamount is aligning with the last field sequence number.

Can anyone please help me find the elusive bug.

Thanks,

Vipul
April 29, 2004, 02:38 PM
<Vipul>
or try this one with car file. Please help.

DEFINE FILE CAR
CNT/I6 = 1;
PAIDCOST/P17.2CM = RETAIL_COST ;
END
TABLE FILE CAR
PRINT CNT NOPRINT
COUNTRY AS 'Country'
MODEL AS 'Model'
PAIDCOST AS 'Retail Cost'
BY COUNTRY NOPRINT
BY HIGHEST PAIDCOST NOPRINT
BY CNT NOPRINT
ON COUNTRY SUBFOOT
"Totals: .lt.ST.CNT .lt.ST.PAIDCOST "
ON TABLE SET STYLE *
TYPE=REPORT, GRID=ON, STYLE=NORMAL, FONT=ARIAL, SIZE=8,
BACKCOLOR=NONE,$
TYPE=SUBFOOT, HEADALIGN = BODY, SQUEEZE=ON, $
TYPE=SUBFOOT, LINE=1, CLASS=bborder, $
TYPE=SUBFOOT, LINE=1, ITEM=3, JUSTIFY=LEFT, $
TYPE=HEADING, LINE=1, SIZE=9, STYLE=BOLD, BACKCOLOR=RGB(192 192 192), $
TYPE=TITLE,STYLE=-UNDERLINE, $
ENDSTYLE
END
-RUN

Run this and let me know how to fix this:

Vipul
April 29, 2004, 03:01 PM
<Vipul>
This is great...Figured it out. If I remove the space between the two .lt.st.cnt and .lt.st.paidamount it works. Was this by design or was this an undocumented feature?

Vipul
April 29, 2004, 03:11 PM
mgrackin
This is by design. The space in between 2 fields in a SUBFOOT or any other HEADING or FOOTING is interpreted as a separate entity and therefore focus creates a column (cell) for that blank space. As you noticed, when you remove the spaces between field references, everything works as expected.
April 29, 2004, 03:18 PM
<Vipul>
Thanks Mickey, I learnt something today. I was banging my head yesterday on this and wondering where I went wrong.

Vipul