Focal Point
[closed]Add Comma's to a Total Field Listed in Heading

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

August 27, 2014, 03:12 PM
TomS.
[closed]Add Comma's to a Total Field Listed in Heading
Hi All,

I want to have a report heading show the report totals. The issue I'm having is with having it show with commas. For example...

TABLE FILE CAR
SUM
SALES
BY
MODEL
HEADING
"THESE ARE THE SALE TOTALS END

This provides me with the total sales # just fine however there are no commas. I also tried making SALES a /D12...still the report has the commas but the heading does not.

I've looked all over and cannot find a solution to this on the forums.

Thanks for any help!

This message has been edited. Last edited by: TomS.,


WebFOCUS 8.0.07 and 8.2.01M
UNIX, WINDOWS, ORACLE
PDF, CSV, Excel, TXT, XML, HTML
August 27, 2014, 05:02 PM
Cyril Joy
DEFINE FILE CAR
SALES1/D12.2=SALES;
END

TABLE FILE CAR
SUM
SALES/D12.2
BY
MODEL
HEADING
"THESE ARE THE SALE TOTALS END


Regards,
Cyril Joy.

WF Production 8008 on Linux.
August 27, 2014, 05:37 PM
Waz
Please post your code between the code tags.


Waz...

Prod:WebFOCUS 7.6.10/8.1.04Upgrade:WebFOCUS 8.2.07OS:LinuxOutputs:HTML, PDF, Excel, PPT
In Focus since 1984
Pity the lost knowledge of an old programmer!

August 28, 2014, 01:46 AM
Rifaz
Hi TomS,

Check, it works for you
FILEDEF XYZ DISK BASEAPP/XYZ.TXT (LRECL 12
-RUN
TABLE FILE CAR
SUM
SALES NOPRINT
COMPUTE SALESD/D6 = SALES; NOPRINT
COMPUTE SALESB/A9 = FTOA(SALES, '(D6)', 'A9'); 
ON TABLE SET HOLDLIST PRINTONLY
ON TABLE HOLD AS XYZ
END
-RUN
-READ XYZ &TEST.A9.
-TYPE &TEST
TABLE FILE CAR
SUM SALES
BY MODEL
HEADING
"Total Sales &TEST.EVAL"
END  



-Rifaz

WebFOCUS 7.7.x and 8.x
August 28, 2014, 05:02 AM
Alan B
A field in a HEADING, SUBHEADING or whatever, will use the original format. Using a format change on a verb object affects only that verb object.
Using a DEFINE is one approach, a COMPUTE is another. However from your code snippet you will NOT get total sales, only the first value for SALES.
You can try:
TABLE FILE CAR
SUM COMPUTE C_SALES/I9C =SALES; NOPRINT
SUM 
SALES
BY 
MODEL
HEADING
"THESE ARE THE SALE TOTALS <C_SALES"
END

or

DEFINE FILE CAR
D_SALES/I10C=SALES;
END

TABLE FILE CAR
SUM 
SALES/I10C
BY 
MODEL
HEADING
"THESE ARE THE SALE TOTALS <TOT.D_SALES"
END



Alan.
WF 7.705/8.007
August 28, 2014, 08:23 AM
TomS.
Doing the define first proved to be the solution.

Thanks all!
Tom

This message has been edited. Last edited by: TomS.,


WebFOCUS 8.0.07 and 8.2.01M
UNIX, WINDOWS, ORACLE
PDF, CSV, Excel, TXT, XML, HTML