As of December 1, 2020, Focal Point is retired and repurposed as a reference repository. We value the wealth of knowledge that's been shared here over the years. You'll continue to have access to this treasure trove of knowledge, for search purposes only.
Join the TIBCO Community TIBCO Community is a collaborative space for users to share knowledge and support one another in making the best use of TIBCO products and services. There are several TIBCO WebFOCUS resources in the community.
From the Home page, select Predict: WebFOCUS to view articles, questions, and trending articles.
Select Products from the top navigation bar, scroll, and then select the TIBCO WebFOCUS product page to view product overview, articles, and discussions.
Request access to the private WebFOCUS User Group (login required) to network with fellow members.
Former myibi community members should have received an email on 8/3/22 to activate their user accounts to join the community. Check your Spam folder for the email. Please get in touch with us at community@tibco.com for further assistance. Reference the community FAQ to learn more about the community.
I have a query and say if I run it,say I may get columns 1,2 and 3 and out of which column 3 gives the number of units sold in $. Now say I will get 3 rows for Column 3 with the values such as $3.00(row 1), $-4.99(row2 ) and $-5.00 (row 3).I need to change the font to green only if there is negative currency(say in the above case,it is row 2 and row3) and to black font if it is a positive currency(row 1).
Can anyone please let me know how to do this in a styling part/section using sample car file.
Any help is greatly appreciated.
Thanks a lot in advance!
Regards, IPThis message has been edited. Last edited by: <Kathryn Henning>,
Right click on field you want to apply color, Options, Style, Edit Conditions, New, Apply color to font.
TABLE FILE CAR
PRINT
COMPUTE N_RET/D10 = RETAIL_COST - 10000;
BY CAR.ORIGIN.COUNTRY
ON TABLE SET PAGE-NUM NOLEAD
ON TABLE NOTOTAL
ON TABLE SET STYLE *
$
DEFMACRO=COND0001,
MACTYPE=RULE,
WHEN=N2 LT 0,
$
TYPE=DATA,
COLUMN=N2,
COLOR='GREEN',
MACRO=COND0001,
$
ENDSTYLE
END
WF versions : Prod 8.2.04M gen 33, Dev 8.2.04M gen 33, OS : Windows, DB : MSSQL, Outputs : HTML, Excel, PDF In Focus since 2007
Posts: 2409 | Location: Montreal Area, Qc, CA | Registered: September 25, 2013
I mostly skip the MACRO part for clarity and prefer to use the column names. This way when columns are being added or removed, the conditional styling keeps working and there is no need for renumbering:
TABLE FILE CAR
PRINT
COMPUTE N_RET/D10 = RETAIL_COST - 10000;
BY CAR.ORIGIN.COUNTRY
ON TABLE SET PAGE-NUM NOLEAD
ON TABLE NOTOTAL
ON TABLE SET STYLE *
$
TYPE=DATA,
COLUMN=N_RET,
COLOR='GREEN',
WHEN=N_RET LT 0,
$
ENDSTYLE
END
WebFOCUS 8105m Windows 7, All Outputs
Member of the Benelux Usergroup
Posts: 198 | Location: Amsterdam | Registered: August 24, 2011
You are right SWES, using the MACRO with the column name is normally what I am doing, but I did the code with the GUI just to be sure that everything remain as the GUI does and show that it's possible.
The advantage of the MACRO is that it can be reused for many columns' styling without having to define the condition on every columns.
It also make the code more clear when using the field name instead of the reference. Using the reference may sometime be confusing especially with COMPUTEs and MULTI LEVEL. Many treads speak about a column with style change when it's not supposed to be that one because a internal MATRIX field (not displayed) as to be considered in the column reference count.
WF versions : Prod 8.2.04M gen 33, Dev 8.2.04M gen 33, OS : Windows, DB : MSSQL, Outputs : HTML, Excel, PDF In Focus since 2007
Posts: 2409 | Location: Montreal Area, Qc, CA | Registered: September 25, 2013
This is very simple; I "always" set a FLAG and never use DEFMACRO, my 2 cents:
TABLE FILE CAR
PRINT
COMPUTE N_RET/P10.2BC = RETAIL_COST - 10000;
COMPUTE FLAG/A1 = IF N_RET LT 0 THEN 'Y' ELSE 'N'; NOPRINT
BY CAR.ORIGIN.COUNTRY
ON TABLE SET PAGE-NUM NOLEAD
ON TABLE NOTOTAL
ON TABLE SET STYLE *
$
TYPE=DATA,
COLUMN=N_RET,
COLOR='GREEN',
WHEN=FLAG EQ 'Y',
$
ENDSTYLE
END
-EXIT