Focal Point
conditional styling on a define field using a define field

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

August 05, 2008, 02:48 PM
KK
conditional styling on a define field using a define field
I am trying to highlight a define field with the following line of code, but it doesn't work.

TYPE=DATA,COLUMN=CURRQTYI,BACKCOLOR=RED,WHEN=IFSGTI EQ 1,$

CURRQTYI and IFSGTI are define fields.

Please help.

Thank you,
KK


Test - Webfocus 7.6.7
Prod - Webfocus 7.6.7
Win2003
Sql Server 2000 and 2008
August 05, 2008, 03:00 PM
GinnyJakes
DEFINE FILE CAR
PROFIT/D12=RETAIL_COST-DEALER_COST;
CKPROF/I1=IF PROFIT GE 1500 THEN 1 ELSE 0;
END
TABLE FILE CAR
PRINT
     SALES
     PROFIT
     CKPROF NOPRINT
BY COUNTRY
BY CAR
BY MODEL
ON TABLE NOTOTAL
ON TABLE SET STYLE *
     UNITS=IN,
     SQUEEZE=ON,
     ORIENTATION=PORTRAIT,
$
     DEFMACRO=COND0001,
     MACTYPE=RULE,
     WHEN=N6 EQ 1,
$
TYPE=REPORT,
     GRID=OFF,
     FONT='TIMES NEW ROMAN',
     SIZE=10,
$
TYPE=DATA,
     COLUMN=N5,
     BACKCOLOR='RED',
     MACRO=COND0001,
$
ENDSTYLE
END


Make sure that you include the field you are testing on in the body of the report and NOPRINT it. See CKPROF above.


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
August 05, 2008, 03:36 PM
KK
Ginny,

Thank you very much for your quick response. I tried that but it isn't working. I noticed that you are using column names (N5 and N6),
I dont' think I can use that in my report as the details are written out under the subhead :-

ON PARTNO SUBHEAD
"Part: <+0> Past 12 Months Sales Qty: <+0>Selected Month Sales Qty: <+0>Selected Month Inventory: CURRQTYI"

"Safety: <+0> SCURRQTY<+0>
Note: Selected month inventory is greater than Safety

I want to highlight this part "Selected Month Inventory: CURRQTYS <+0>" and display a message "Note: Selected month inventory is greater than Safety"

Here is the define field code IFSGTI/I2 = IF SCURRQTY GT CURRQTYI THEN 1 ELSE 0;

Thanks,
KK.

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


Test - Webfocus 7.6.7
Prod - Webfocus 7.6.7
Win2003
Sql Server 2000 and 2008
August 05, 2008, 04:24 PM
KK
Tom,

I didn't post the code but I am printing those define fields

TABLE FILE HOLD1
SUM SALEQTY
SCURRQTY
CURRQTYI
IFSGTI NOPRINT

etc..
END


Test - Webfocus 7.6.7
Prod - Webfocus 7.6.7
Win2003
Sql Server 2000 and 2008
August 05, 2008, 04:29 PM
GinnyJakes
You can use the column name instead of the notation. I did my styling with the Report Painter and didn't go back and change it. Either should work.


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
August 05, 2008, 04:41 PM
FrankDutch
KK

Please post your whole code. It is a bit confusing to see only some lines.

I think your "compute" line should be in the table part instead of in the define.
You are summing records instead of printing.




Frank

prod: WF 7.6.10 platform Windows,
databases: msSQL2000, msSQL2005, RMS, Oracle, Sybase,IE7
test: WF 7.6.10 on the same platform and databases,IE7

August 05, 2008, 04:49 PM
<Meghan>
I want to do the EXACT same thing but I want the computed column to also display in my report and to have the associated background styling in relation to another column. Can anyone help?
August 05, 2008, 05:36 PM
Prarie
Meghan,

Welcome to the Forum.
Please ** Update signature This helps us help you with what version you are using.

1) Logon to Focal Point and go into your complete profile.
2) Scroll down the page until you see the “Signature” field.
3) Fill in the signature you want to use. Here is a sample to model:

Prod: WebFOCUS 5.2.3 on Win 2K/IIS 6/ISAPI Mode
Test: WebFOCUS 7.1 on Win 2K/IIS 6/Weblogic 8.1/Servlet Mode

4) Once all changes are made/added, scroll down to the bottom of the page and click on the Submit button.


In Focus since 1993. WebFOCUS 7.7.03 Win 2003
I noticed the you wanted to print out a note which is conditional to month inventory greated than safety:
quote:
Note: Selected month inventory is greater than Safety


In order to do that you have to issue 2 SUBFOOT operations, the second having a WHEN clause. See the following:
  
-* File CondColors.fex
SET BYDISPLAY = ON
SET CENT-ZERO=ON

DEFINE FILE CAR
RATIO/D6.3=DEALER_COST / RETAIL_COST;
PROFIT/D7=RETAIL_COST - DEALER_COST;
END
TABLE FILE CAR
BY COUNTRY
BY CAR
BY MODEL
BY RATIO NOPRINT

ON MODEL SUBHEAD
" "
ON MODEL SUBFOOT
" <+0>Dealer Cost: <DEALER_COST Retail Cost: <RETAIL_COST  Profit: <PROFIT "
"Ratio: <RATIO "
ON MODEL SUBFOOT
"Ratio less than 0.84"
WHEN RATIO LT 0.84;
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,
     SQUEEZE=ON,
     ORIENTATION=PORTRAIT,
$
     DEFMACRO=COND84,
     MACTYPE=RULE,
     WHEN=N4 LT 0.84,
$
TYPE=REPORT,
     GRID=OFF,
     FONT='ARIAL',
     SIZE=9,
$
TYPE=TITLE,
     STYLE=BOLD,
$
TYPE=SUBFOOT,
     SIZE=10,
$
TYPE=SUBFOOT,
     BY=3,
     LINE=1,
     OBJECT=TEXT,
     ITEM=1,
     COLOR='RED',
     MACRO=COND84,
$
TYPE=SUBFOOT,
     BY=3,
     LINE=1,
     OBJECT=TEXT,
     ITEM=4,
     COLOR='RED',
     MACRO=COND84,
$
TYPE=SUBFOOT,
     BY=3,
     LINE=1,
     OBJECT=FIELD,
     ITEM=3,
     COLOR='RED',
     MACRO=COND84,
$
ENDSTYLE
END

You will notice that when there are 2 SUBFOOT operations, WF will not distinguish between the two for styling. This means that coding the style is a bit tricky.
See that in order to color the note, WF addresses it as LINE=1 also:
  
TYPE=SUBFOOT,
     BY=3,
     LINE=1,
     OBJECT=TEXT,
     ITEM=1,
     COLOR='RED',
     MACRO=COND84,
$

That is why, it is necessary to add a dummy text field in LINE 1 of the first SUBFOOT operation.
  
" <+0>Dealer Cost: <DEALER_COST Retail Cost: <RETAIL_COST  Profit: <PROFIT "


I hope this helps.


Daniel
In Focus since 1982
wf 8.202M/Win10/IIS/SSA - WrapApp Front End for WF