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 am newbie and I am trying to change color of the values in my column if it meets 2 criteria. I am applying conditional formatting 'WHEN' and I'm getting this error: (FOC3202) BAD VALUE IN STYLESHEET FILE AT LINE: 15 WHEN=N2 GE '8000' AND N4 EQ 'E'
Here's my code:
TABLE FILE SQLOUT PRINT fleetId equipmentNumber currentPro serviceType ON TABLE NOTOTAL ON TABLE PCHOLD FORMAT EXL2K ON TABLE SET STYLE * UNITS=IN, SQUEEZE=ON, ORIENTATION=PORTRAIT, $ TYPE=REPORT, GRID=OFF, FONT='TIMES NEW ROMAN', SIZE=10, $ TYPE=DATA, COLUMN=N2, BACKCOLOR='AQUA', WHEN=equipmentNumber GE '8000' AND serviceType EQ 'E', $ ENDSTYLE END
To do a condition on two variables, you'll have to set up a define that is true or false, 1 or 0, depending on the evaluation of your variables. You can then test that field in your stylesheet.
For example the define would be:
CONDSW/I1=IF EQUIPMENTNUMBER GE '8000' AND SERVICETYPE EQ 'E' THEN 1 ELSE 0;
Thanks, Ginny! I set up a define just as you advised, but it didn't seem to work. The report ran fine, but it's not highlighting the criteria I specified. I even narrowed it to just one criteria using the define, but it still didn't work...
I ran into this recently and learned that the conditional criteria must be simple (only one criteria) and not compound - as Ginny states. However, our workaround was the solution she provides and it works fine so there must be something else going on.
There is one additional way to do this and that is by creating a macro condition such as DEFMACRO=COND0001, MACTYPE=RULE, WHEN=CONDSW EQ 1,$
One other issue that you may be having is that not all stylesheet properties are respected when output to Excel. I don't know if BACKCOLOR may be one of them. Have you just tried running as is using HTML and see if it works?
Regards,
Darin
In FOCUS since 1991 WF Server: 7.7.04 on Linux and Z/OS, ReportCaster, Self-Service, MRE, Java, Flex Data: DB2/UDB, Adabas, SQL Server Output: HTML,PDF,EXL2K/07, PS, AHTML, Flex WF Client: 77 on Linux w/Tomcat
Posts: 2298 | Location: Salt Lake City, Utah | Registered: February 02, 2007
Thanks, Darin. I tried your code and use the HTML output and it didn't work, either...Good news is, instead of using 'EQ' in the WHEN clause, I used "NE" and it worked.
TYPE=DATA, COLUMN=N1, BACKCOLOR='BLUE', WHEN=CONDSW NE 0, $
Hmm! Seems like it would be the same thing - but whatever works would be the correct answer. Glad you got it working!
Regards,
Darin
In FOCUS since 1991 WF Server: 7.7.04 on Linux and Z/OS, ReportCaster, Self-Service, MRE, Java, Flex Data: DB2/UDB, Adabas, SQL Server Output: HTML,PDF,EXL2K/07, PS, AHTML, Flex WF Client: 77 on Linux w/Tomcat
Posts: 2298 | Location: Salt Lake City, Utah | Registered: February 02, 2007
WHEN in stylesheet (like COMPUTE or WHERE TOTAL)applies to the accumulated data (the "internal matrix"). If a data-reduction verb is used (SUM, WRITE) then the accumulated value of CONDSW may be > 1, in which case the "NE 0" condition it triggered, but not the "EQ 1".
For that reason, base the styling on a COMPUTE (as Dan suggests), not a DEFINE.
- Jack Gross WF through 8.1.05
Posts: 1925 | Location: NYC | In FOCUS since 1983 | Registered: January 11, 2005
To do a condition on two variables, you'll have to set up a define that is true or false, 1 or 0, depending on the evaluation of your variables. You can then test that field in your stylesheet.
Use a variation of Ginny’s example but make the DEFINE an alphanumeric value instead of numeric. Then the EQ seems to work.
DEFINE FILE CAR CONDSW/A1=IF COUNTRY GE 'JAPAN' AND CAR EQ 'DATSUN' THEN '1' ELSE '0'; END