[SOLVED] How do you get a total to print on one line?
I would like to print a simple column-total on one line. I do not have any sort fields. When I attempt to do this, the phrase 'TOTAL' prints on one line, and the total amounts on the second line. Does anyone know how to eliminate this problem? I am directing my output to PDF.
Here is an example that prints on two lines.
TABLE FILE CAR PRINT MODEL SALES ON TABLE COLUMN-TOTAL AS 'TOTAL' ON TABLE PCHOLD FORMAT PDF ENDThis message has been edited. Last edited by: FP Mod Chuck,
July 18, 2005, 09:28 PM
k.lane
You could do this:
DEFINE FILE CAR DUMMY/A1 = ' '; END
TABLE FILE CAR SUM SALES BY DUMMY NOPRINT BY MODEL ON DUMMY SUBFOOT " " "TOTAL <ST.SALES" ON TABLE SET STYLE * TYPE=SUBFOOT, LINE=2, STYLE=BOLD, $ TYPE=SUBFOOT, LINE=2, OBJECT=FIELD, ITEM=1, POSITION=SALES, $ ENDSTYLE ON TABLE PCHOLD FORMAT PDF END
I tried it without the dummy sort field with ON TABLE SUBFOOT, but the styling wouldn't work.
The above does the trick though.
Ken
July 18, 2005, 09:30 PM
k.lane
This works as well if you were looking for a straight dump from the table.
TABLE FILE CAR PRINT MODEL SALES BY DUMMY NOPRINT
Ken
July 18, 2005, 09:46 PM
reFOCUSing
At summit there was a great presentation by B.J. Stepien called Why Weird Things Happen in Reporting and it covered the problem you are having.
I was attempting to do a report with column-totals while not sorting on any field, but I guess if you want to avoid the problem of a two line total, you must either use the SUBFOOT technique, or SORT on at least one of your PRINT columns and use the DUMMY NOPRINT technique.