Focal Point
Conditional styling

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

February 08, 2008, 09:05 AM
Majid Jeddi
Conditional styling
Hi,

I have a report shoiwing data grouped by country and showing the detail of a field called amount.
in the subtotal i would like to display the sum of field amount in red if it is less then zéro but i am not able.

Any idea on how to do this.

Regards.

Majid.


WebFocus 7.6.5
AND WebLogic server as web server
sql2005 as database server
February 08, 2008, 09:39 AM
GinnyJakes
I did this with the Report Painter but you could do it by hand if you wanted to. I just clicked on the SALES_DISC field, added a condition, and then made it red.
TABLE FILE CAR
SUM
     SALES
     COMPUTE SALES_DISC/D12 = SALES - 500;
BY RPTDATE NOPRINT
BY COUNTRY
BY CAR
BY MODEL

ON COUNTRY SUBTOTAL AS '*TOTAL'
HEADING
"Car Sales Report</1"
ON TABLE SET PAGE-NUM OFF
ON TABLE NOTOTAL
ON TABLE PCHOLD FORMAT HTML
ON TABLE SET HTMLCSS ON
ON TABLE SET STYLE *
     UNITS=IN,
     LEFTMARGIN=0.000000,
     RIGHTMARGIN=0.000000,
     TOPMARGIN=0.000000,
     BOTTOMMARGIN=0.000000,
     SQUEEZE=ON,
     ORIENTATION=PORTRAIT,
$
     DEFMACRO=COND0001,
     MACTYPE=RULE,
     WHEN=N6 LT 0,
$
TYPE=REPORT,
     GRID=OFF,
     FONT='ARIAL',
     SIZE=9,
     COLOR='BLACK',
     BACKCOLOR='NONE',
     STYLE=NORMAL,
     RIGHTGAP=0.125000,
     TOPGAP=0.013889,
     BOTTOMGAP=0.027778,
$
TYPE=DATA,
     COLUMN=N1,
     FOCEXEC=CARPROFIT(COUNTRY=N1),
$
TYPE=TITLE,
     STYLE=BOLD,
$
TYPE=HEADING,
     SIZE=12,
     COLOR='RED',
     STYLE=BOLD,
$
TYPE=HEADING,
     LINE=1,
     JUSTIFY=CENTER,
$
TYPE=HEADING,
     LINE=1,
     OBJECT=TEXT,
     ITEM=1,
     SIZE=14,
$
TYPE=SUBTOTAL,
     BACKCOLOR=RGB(210 210 210),
$
TYPE=SUBTOTAL,
     BY=2,
     COLUMN=N6,
     BACKCOLOR='RED',
     MACRO=COND0001,
$
TYPE=GRANDTOTAL,
     BACKCOLOR=RGB(210 210 210),
     STYLE=BOLD,
$
ENDSTYLE
END



Ginny
---------------------------------
Prod: WF 7.7.01 Dev: WF 7.6.9-11
Admin, MRE,self-service; adapters: Teradata, DB2, Oracle, SQL Server, Essbase, ESRI, FlexEnable, Google
February 11, 2008, 03:03 AM
Majid Jeddi
Hi Ginny,

I was not precise in the description of my issue.
I have 2 fields in the sub total : Amount1 and Amount2 and I would like just to show the total Amount2 in red when it is less than 0 and let the other totals alone.

Thanks

Majid.


WebFocus 7.6.5
AND WebLogic server as web server
sql2005 as database server
February 11, 2008, 03:44 AM
Tony A
quote:
to show the total Amount2 in red when it is less than 0 and let the other totals alone.
Which is exactly what Ginny's code does ....

T



In FOCUS
since 1986
WebFOCUS Server 8.2.01M, thru 8.2.07 on Windows Svr 2008 R2  
WebFOCUS App Studio 8.2.06 standalone on Windows 10 
February 11, 2008, 04:17 AM
Majid Jeddi
Hi Tony and Ginny,

Yes it is working. I had just to close the explorer and to launch it again to see the result.
Thanks.


WebFocus 7.6.5
AND WebLogic server as web server
sql2005 as database server