Forums
FOCUS/WebFOCUS
conditional styling on a define field using a define field|
Go
![]() |
New
![]() |
Search
![]() |
Notify
![]() |
Tools
![]() |
Reply
![]() |
|
|
Silver Member |
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.1 Prod - Webfocus 7.6.1 Win2003 Sql Server |
||
|
|
Virtuoso |
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.6.5 with 7.6.5 WFRS; AIX 5.2; WebSphere 6.1.0.15 Dev: WF 7.6.5 with 7.6.5 WFRS; AIX 5.2; WebSphere 6.1.0.15 Primarily self-service; adapters: Teradata, DB2, Oracle, SQL Server, Essbase, ESRI, FlexEnable |
|||
|
|
Silver Member |
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: "Safety: <+0> SCURRQTY<+0> 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.1 Prod - Webfocus 7.6.1 Win2003 Sql Server |
|||
|
|
Master |
KK,
Just because you add a DEFINE, doesn't mean it's part of the output record unless you PRINT/SUM it: DEFINE FILE WHATEVER IFSGTI/I2 = IF SCURRQTY GT CURRQTYI THEN 1 ELSE 0; END TABLE FILE WHATEVER PRINT/SUM COLUMN1 COLUMN2 IFSGT1 NOPRINT COLUMN3 ETC... Another example is COMPUTE: TABLE FILE WHATEVER PRINT/SUM COLUMN1 COLUMN2 COMPUTE IFSGTI/I2 = IF SCURRQTY GT CURRQTYI THEN 1 ELSE 0; NOPRINT COLUMN3 ETC... Now the styling will work... Tom Tom Flynn WebFOCUS 5.2.2 thru 7.6.x Windows, Unix, MVS |
|||
|
|
Silver Member |
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.1 Prod - Webfocus 7.6.1 Win2003 Sql Server |
|||
|
|
Virtuoso |
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.6.5 with 7.6.5 WFRS; AIX 5.2; WebSphere 6.1.0.15 Dev: WF 7.6.5 with 7.6.5 WFRS; AIX 5.2; WebSphere 6.1.0.15 Primarily self-service; adapters: Teradata, DB2, Oracle, SQL Server, Essbase, ESRI, FlexEnable |
|||
|
|
Virtuoso |
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.
|
|||||||
|
|
Member |
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?
Prod: WebFOCUS 7.6.6 on Win XP |
|||
|
|
Virtuoso |
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.
|
|||||
|
|
Master |
KK,
If you want to style items in the SUBHEAD, then TYPE=DATA,COLUMN=CURRQTYI,BACKCOLOR=RED,WHEN=IFSGTI EQ 1,$ is styling DATA, not SUBHEAD To style SUBHEAD, you have to identify ITEMs ON PARTNO SUBHEAD "Part: <+0> Past 12 Months Sales Qty: <+0>Selected Month Sales Qty: <+0>Selected Month Inventory: <CURRQTYI" Part: will be Item=1 Past 12 Months Sales Qty: will be ITEM=2 Selected Month Sales Qty: will be ITEM=3 Selected Month Inventory: will be ITEM=4 <CURRQTYI will be item 5 Now, since you did not put your code between the code tags(the tab at the end of the above toolbar) all of the above is a "maybe", since we can't see if there are any FIELDS after the colon; I'm sure there is, so, best guess, here is an "example": TYPE=SUBHEAD,ITEM=ITEM1,OBJECT=TEXT, COLOR=BLUE,$ TYPE=SUBHEAD,ITEM=ITEM1,OBJECT=FIELD,COLOR=RED,$ TYPE=SUBHEAD,ITEM=ITEM2,OBJECT=TEXT, COLOR=BLUE,$ TYPE=SUBHEAD,ITEM=ITEM2,OBJECT=FIELD,COLOR=RED,$ Continue with the above concept to identify each part of the SUBHEAD, then, incorporate your WHEN test... Have fun... Tom Tom Flynn WebFOCUS 5.2.2 thru 7.6.x Windows, Unix, MVS |
|||
|
|
Master |
I noticed the you wanted to print out a note which is conditional to month inventory greated 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. |
|||
|
| Previous Topic | Next Topic | powered by eve community |
| Please Wait. Your request is being processed... |
|
Forums
FOCUS/WebFOCUS
conditional styling on a define field using a define field
