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.
That is how my table looks for example - based on col1 & col2 I have to format the fields of the other columns. So IF COL1 & ROW1 = BOLD THEN make ROW1 in COL3 as BOLD IF COL2 & ROW1 = BOLD+UNDERLINE THEN make ROW1 in COL5 as BOLD & Underline
Can we do this in WebFocus - cellular level formatting?
I have to display 4 columns on a PDF page - COL3, COL4, COL5 & COL6 - with few rows in between as BOLD etc depending on the clues/values from COL1 & COL2.
Any ideas/advise? Thanks!This message has been edited. Last edited by: Nova27,
You can create a conditional style based on whatever threshold you want. Look up MACTYPE or Conditional Styling in the doc. In InfoAssist it's an icon called Traffic Lights. For instance:
TABLE FILE ibisamp/car
SUM CAR.BODY.SEATS
BY CAR.ORIGIN.COUNTRY
BY CAR.CARREC.MODEL
BY CAR.COMP.CAR
BY CAR.BODY.BODYTYPE
ON TABLE PCHOLD FORMAT HTML
ON TABLE NOTOTAL
ON TABLE SET CACHELINES 100
ON TABLE SET GRWIDTH 1
ON TABLE SET STYLE *
INCLUDE=IBFS:/FILE/IBI_HTML_DIR/ibi_themes/Warm.sty,$
DEFMACRO=Condition_1, MACTYPE=RULE, WHEN=CAR EQ 'BMW', $
TYPE=DATA, COLUMN=CAR, MACRO=Condition_1, FONT='ARIAL', SIZE=14, COLOR=RGB(0 0 255), STYLE=BOLD, HYPERLINK-COLOR=RGB(0 0 255), $
ENDSTYLE
END
This message has been edited. Last edited by: BabakNYC,
WebFOCUS 8206, Unix, Windows
Posts: 1853 | Location: New York City | Registered: December 30, 2015
Originally posted by BabakNYC: You can create a conditional style based on whatever threshold you want. Look up MACTYPE or Conditional Styling in the doc. In InfoAssist it's an icon called Traffic Lights. For instance:
TABLE FILE ibisamp/car
SUM CAR.BODY.SEATS
BY CAR.ORIGIN.COUNTRY
BY CAR.CARREC.MODEL
BY CAR.COMP.CAR
BY CAR.BODY.BODYTYPE
ON TABLE PCHOLD FORMAT HTML
ON TABLE NOTOTAL
ON TABLE SET CACHELINES 100
ON TABLE SET GRWIDTH 1
ON TABLE SET STYLE *
INCLUDE=IBFS:/FILE/IBI_HTML_DIR/ibi_themes/Warm.sty,$
DEFMACRO=Condition_1, MACTYPE=RULE, WHEN=CAR EQ 'BMW', $
TYPE=DATA, COLUMN=CAR, MACRO=Condition_1, FONT='ARIAL', SIZE=14, COLOR=RGB(0 0 255), STYLE=BOLD, HYPERLINK-COLOR=RGB(0 0 255), $
ENDSTYLE
END
Is it possible to do this without hardcoding the CAR value 'BMW' - can I use ROW reference?
where NEW_CAR is another column in the table or something you DEFINEd.
And by the way, you don't have to always say EQ you can use whatever logical operator you want. So, you could say Not EQ (NE) or Greater Than (GT).This message has been edited. Last edited by: BabakNYC,
WebFOCUS 8206, Unix, Windows
Posts: 1853 | Location: New York City | Registered: December 30, 2015
There are many ways to accomplish the task. Yours works just as well. The key is WHEN= syntax.
TABLE FILE ibisamp/car
SUM CAR.BODY.SEATS
BY CAR.ORIGIN.COUNTRY
BY CAR.CARREC.MODEL
BY CAR.COMP.CAR
BY CAR.BODY.BODYTYPE
ON TABLE PCHOLD FORMAT HTML
ON TABLE NOTOTAL
ON TABLE SET CACHELINES 100
ON TABLE SET GRWIDTH 1
ON TABLE SET STYLE *
INCLUDE=IBFS:/FILE/IBI_HTML_DIR/ibi_themes/Warm.sty,$
TYPE=DATA, COLUMN=MODEL, STYLE=BOLD, WHEN=CAR EQ 'BMW', FONT='ARIAL', SIZE=14, COLOR=RGB(0 0 255), HYPERLINK-COLOR=RGB(0 0 255), $
ENDSTYLE
END
WebFOCUS 8206, Unix, Windows
Posts: 1853 | Location: New York City | Registered: December 30, 2015
But this highlighted the whole row for value 'ABC' as silver - I want only ABC in COL1 highlighted and bold. I tried using the DEFMACRO & MACTYPE commands too, same result
I am using this conditional formatting in PDF report - is that the reason for this?
Also, I just noticed that the STYLE=BOLD applies only to ABC in COL1 (as expected), but BACKCOLOR=SILVER is the issue - the entire row has SILVER backcolor.
SET BYDISPLAY=ON
TABLE FILE CAR
SUM
SALES
BY COUNTRY
BY CAR
BY MODEL
ON TABLE PCHOLD FORMAT PDF
ON TABLE SET STYLE *
TYPE=REPORT, FONT=CALIBRI, SIZE=9, $
TYPE=DATA, COLUMN=CAR, STYLE=BOLD, BACKCOLOR=SILVER, WHEN=CAR EQ 'ALFA ROMEO', $
END
-RUN
-RUN
Francis
Give me code, or give me retirement. In FOCUS since 1991
Production: WF 7.7.05M, Dev Studio, BID, MRE, WebSphere, DB2 / Test: WF 8.1.05M, App Studio, BI Portal, Report Caster, jQuery, HighCharts, Apache Tomcat, MS SQL Server
Here a sample using MACROs and where you can either apply styling to a specific column or row
DEFINE FILE CAR
SEATS5 /A1 = IF SEATS EQ 5 THEN 'Y' ELSE 'N';
ENGLAND /A1 = IF COUNTRY EQ 'ENGLAND' THEN 'Y' ELSE 'N';
ENGSEATS2 /A1 = IF COUNTRY EQ 'ENGLAND' AND SEATS EQ 2 THEN 'Y' ELSE 'N';
BMWSEATS4 /A1 = IF CAR EQ 'BMW' AND SEATS EQ 4 THEN 'Y' ELSE 'N';
END
TABLE FILE CAR
PRINT SEATS
SEATS5 NOPRINT
ENGLAND NOPRINT
ENGSEATS2 NOPRINT
BMWSEATS4 NOPRINT
BY COUNTRY
BY CAR
ON TABLE SET PAGE-NUM NOLEAD
ON TABLE PCHOLD FORMAT HTML
ON TABLE NOTOTAL
ON TABLE SET BYDISPLAY ON
ON TABLE SET HTMLCSS ON
ON TABLE SET STYLE *
INCLUDE = IBFS:/EDA/EDASERVE/_EDAHOME/ETC/endeflt.sty,
$
DEFMACRO=ROWSEATS5,
MACTYPE=RULE,
WHEN=SEATS5 EQ 'Y',
$
DEFMACRO=ENGCNTRY,
MACTYPE=RULE,
WHEN=ENGLAND EQ 'Y',
$
DEFMACRO=ENG_SEATS2,
MACTYPE=RULE,
WHEN=ENGSEATS2 EQ 'Y',
$
DEFMACRO=BMW_SEATS4,
MACTYPE=RULE,
WHEN=BMWSEATS4 EQ 'Y',
$
TYPE=DATA,
COLOR=BLUE,
MACRO=ROWSEATS5,
$
TYPE=DATA,
COLUMN=SEATS,
COLOR=RED,
MACRO=ENG_SEATS2,
$
TYPE=DATA,
COLUMN=COUNTRY,
BACKCOLOR=YELLOW,
MACRO=ENGCNTRY,
$
TYPE=DATA,
COLUMN=COUNTRY,
BACKCOLOR=GREEN,
COLOR=WHITE,
MACRO=BMW_SEATS4,
$
TYPE=DATA,
COLUMN=SEATS,
BACKCOLOR=GREEN,
COLOR=WHITE,
MACRO=BMW_SEATS4,
$
ENDSTYLE
END
-RUN
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
There were some minor changes I had to make inorder for the conditional formatting to work. That was making all the columns for a particular row to have backcolor = silver.
I had given positions to my columns (for example: COL1 IN 5, COL2 IN 20, etc...) in my fex since I needed them to appear in a certain layout, but I got rid of the "IN position" statements and adjusted the positions using SQUEEZE/WRAP later.
Doing that made it all better - conditional formatting is working as expected.
You can style individual cells when you do a FML(Financial Modeling Language) report. This requires the FOR keyword. Rows are referenced by labels.
TABLE FILE CAR
SUM
DEALER_COST
RETAIL_COST
SALES
FOR
CAR
'AUDI' AS 'AUDI' LABEL R1 OVER
'BMW' AS 'BMW' LABEL R2
ON TABLE PCHOLD FORMAT PDF
ON TABLE SET STYLE *
$
TYPE=DATA,
LABEL=R2,
COLUMN=N4,
BACKCOLOR='YELLOW',
$
ENDSTYLE
END
Just out of curiosity, I tried this but it failed. Can someone tell me what am I missing here?
-SET &I=1;
TABLE FILE CAR
SUM SALES
DEALER_COST
BY COUNTRY
BY CAR
BY MODEL
ON TABLE SET PAGE-NUM NOLEAD
ON TABLE PCHOLD FORMAT HTML
ON TABLE NOTOTAL
ON TABLE SET BYDISPLAY ON
ON TABLE SET HTMLCSS ON
ON TABLE SET STYLE *
INCLUDE = IBFS:/EDA/EDASERVE/_EDAHOME/ETC/endeflt.sty,
$
-REPEAT PTEST WHILE &I LT 5;
TYPE=DATA,
COLUMN=N&I ,
BACKCOLOR='YELLOW',
WHEN=COUNTRY EQ 'JAPAN',
$
-PTEST
ENDSTYLE
END
Using this format the entire row according to condition
TABLE FILE CAR
SUM SALES
DEALER_COST
BY COUNTRY
BY CAR
BY MODEL
ON TABLE SET PAGE-NUM NOLEAD
ON TABLE PCHOLD FORMAT HTML
ON TABLE NOTOTAL
ON TABLE SET BYDISPLAY ON
ON TABLE SET HTMLCSS ON
ON TABLE SET STYLE *
INCLUDE = IBFS:/EDA/EDASERVE/_EDAHOME/ETC/endeflt.sty,
$
TYPE=DATA,
BACKCOLOR='YELLOW',
WHEN=COUNTRY EQ 'JAPAN',
$
ENDSTYLE
END
But this also work, however it does for 5 columns only
TABLE FILE CAR
SUM SALES
DEALER_COST
BY COUNTRY
BY CAR
BY MODEL
ON TABLE SET PAGE-NUM NOLEAD
ON TABLE PCHOLD FORMAT HTML
ON TABLE NOTOTAL
ON TABLE SET BYDISPLAY ON
ON TABLE SET HTMLCSS ON
ON TABLE SET STYLE *
INCLUDE = IBFS:/EDA/EDASERVE/_EDAHOME/ETC/endeflt.sty,
$
-REPEAT PTEST FOR &I FROM 1 TO 5;
TYPE=DATA,
COLUMN=N&I.EVAL,
BACKCOLOR='YELLOW',
WHEN=COUNTRY EQ 'JAPAN',
$
-PTEST
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