Focal Point
[SOLVED] problem with subtotal dynamic format change

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

October 18, 2013, 11:20 AM
santu
[SOLVED] problem with subtotal dynamic format change
Hi,

I am facing problem with subtotal format. I am able to change the format of the column data dynamically but subtotal format i am not able to change. can anyone tell me a way to change the format of subtotal as well?

TABLE FILE CAR
SELECT * FROM CAR
END

DEFINE FILE CAR
DISP_FORMAT/A10 = IF COUNTRY EQ 'FRANCE' OR COUNTRY EQ 'ITALY' THEN 'D30C' ELSE 'D30.2CM';
END

TABLE FILE CAR
SUM RCOST/DISP_FORMAT
BY COUNTRY BY CAR
ON COUNTRY SUBFOOT
"MY OWN TEXT COST IS END

Thanks in advance

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


Web FOCUS 7.7.03
PDF
October 18, 2013, 12:02 PM
Doug
How would the SUBTOTAL know which of the two formats to use?
October 18, 2013, 12:41 PM
santu
Yes and how to display in correct format?

I think my code was missing. please refer the below code.

when i use SUBTOTAL then it is working for me but i wanted to use SUBFOOT only because of below points.
1.total label and total amounts are not coming in one line
2.I wanted to give red color to the values when it is negative.

Is there any way to give red color to subtotal if we use SUBTOTAL?


 TABLE FILE CAR
SELECT * FROM CAR
END
 
DEFINE FILE CAR
DISP_FORMAT/A10 = IF COUNTRY EQ 'FRANCE' OR COUNTRY EQ 'ITALY' THEN 'D30C' ELSE 'D30.2CM';
END
 
TABLE FILE CAR
SUM RCOST/DISP_FORMAT
BY COUNTRY BY CAR
ON COUNTRY SUBFOOT 
"MY OWN TEXT COST IS <ST.RCOST "
END
 



Web FOCUS 7.7.03
PDF
October 18, 2013, 12:52 PM
Spence
SET PAGE = NOLEAD
DEFINE FILE CAR
DISP_FORMAT/A10 = IF COUNTRY EQ 'FRANCE' OR COUNTRY EQ 'ITALY' THEN 'D30C' ELSE 'D30.2CM';
RCOST1/D15C =     IF COUNTRY EQ 'FRANCE' OR COUNTRY EQ 'ITALY' THEN RCOST ELSE 0;
RCOST2/D15.2CM =  IF COUNTRY NE 'FRANCE' OR COUNTRY EQ 'ITALY' THEN RCOST ELSE 0;
END
TABLE FILE CAR
SUM
	RCOST/DISP_FORMAT
BY  COUNTRY
BY  CAR
ON COUNTRY SUBFOOT
"MY OWN TEXT COST IS: <+0> <ST.RCOST1 "
WHEN COUNTRY EQ 'FRANCE' OR 'ITALY'

ON COUNTRY SUBFOOT
"MY OWN TEXT COST IS: <+0> <ST.RCOST2 "
WHEN COUNTRY NE 'FRANCE' OR 'ITALY'
ON TABLE PCHOLD FORMAT PDF
ON TABLE SET HTMLCSS ON
ON TABLE SET STYLE *
-*TYPE=REPORT, ORIENTATION=LANDSCAPE, GRID=ON, WRAP=OFF, SIZE=9, FONT=ARIAL,$
TYPE=SUBFOOT, LINE=1, BACKCOLOR=SILVER, ITEM=1, COLSPAN=2,  $
TYPE=SUBFOOT, LINE=1, BACKCOLOR=RED, ITEM=3, COLSPAN=3, WHEN=RCOST GT 50000,  $
ENDSTYLE
END 
 

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


WF 8 version 8.2.04. Windows.
In focus since 1990.
October 18, 2013, 03:32 PM
Doug
Very Interesting Smiler
October 21, 2013, 10:29 AM
santu
Brilliant..

Thank you for code snippet.

Its working.


Web FOCUS 7.7.03
PDF