Focal Point Banner


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.


Focal Point    Focal Point Forums  Hop To Forum Categories  WebFOCUS/FOCUS Forum on Focal Point     style error in 7.69 [SOLVED]

Read-Only Read-Only Topic
Go
Search
Notify
Tools
style error in 7.69 [SOLVED]
 Login/Join
 
Master
posted
I have been playing around in 7.69 with a simple test style sheet report (to port this code to a business applicaation).

And, I am not getting the result I want. I am
hoping to get the Country column to display in
RED ITALIC when a new country is displayed.

Any ideas?

Thanks! Music

quote:

-SET &ECHO=ALL;

SET NODATA = ' ', HOLDLIST = PRINTONLY

TABLE FILE CAR
PRINT
COMPUTE CFLAG/A1 = IF COUNTRY EQ LAST COUNTRY THEN '0'
ELSE IF COUNTRY NE LAST COUNTRY THEN '1' ELSE '0';
CAR
MODEL
BODYTYPE
BY COUNTRY
ON TABLE HOLD AS FL1
END
-RUN

TABLE FILE FL1
PRINT
CAR
MODEL
BODYTYPE
BY COUNTRY
ON TABLE PCHOLD FORMAT EXL2K
ON TABLE SET HTMLCSS ON
ON TABLE SET STYLE *
UNITS=IN,
SQUEEZE=ON,
ORIENTATION=PORTRAIT,
$
TYPE=REPORT,
GRID=OFF,
FONT='ARIAL',
SIZE=9,
RIGHTGAP=0.125000,
$
TYPE=HEADING,
FONT='TIMES NEW ROMAN',
SIZE=12,
BACKCOLOR=RGB(255 255 153),
$
TYPE=HEADING,
LINE=1,
OBJECT=TEXT,
ITEM=1,
COLOR='GREEN',
STYLE=BOLD,
JUSTIFY=CENTER,
$
TYPE=DATA,
STYLE=ITALIC,
COLOR='RED',
BACKCOLOR='WHITE',
WHEN=CFLAG EQ '1',
$
TYPE=DATA,
STYLE=NORMAL,
COLOR='BLUE',
BACKCOLOR='WHITE',
WHEN=CFLAG EQ '0',
$
ENDSTYLE
-NOSTY
END
-RUN

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


Tomsweb
WebFOCUS 8.1.05M, 8.2.x
APP Studio, Developer Studio, InfoAssist, Dashboards, charts & reports
Apache Tomcat/8.0.36
 
Posts: 573 | Location: Baltimore, MD | Registered: July 06, 2006Report This Post
Expert
posted Hide Post
You must specify the column in a MACRO in the Table Request.

Add CFLAG NOPRINT, and it should work.


Waz...

Prod:WebFOCUS 7.6.10/8.1.04Upgrade:WebFOCUS 8.2.07OS:LinuxOutputs:HTML, PDF, Excel, PPT
In Focus since 1984
Pity the lost knowledge of an old programmer!

 
Posts: 6349 | Location: 33°49'23.0"S, 151°11'41.0"E | Registered: October 31, 2006Report This Post
Virtuoso
posted Hide Post
You may also need to add COLUMN=COUNTRY to your two DATA stylesheet statements if you only want the COUNTRY column styled.


WebFOCUS 7.7.05
 
Posts: 1213 | Location: Seattle, Washington - USA | Registered: October 22, 2007Report This Post
Platinum Member
posted Hide Post
I see fourissues.

1) you do not have CFLAG in your second matrix, hence the conditions can never be met. Add:
BY CFLAG NOPRINT

to your output after the BY COUNTRY line.

2) You did not turn BYDISPAY ON, hence the only time you will ever see the COUNTRY value is when it changes. Since your backcolor is always white, I would just set the style to red italic for the country column and forget the conditions

3) Which brings me to issue 3, which is you did not include a COLUMN=N1, or COLUMN=COUNTRY, line in either TYPE=DATA, section of the style sheet, so the style would have affected all colimns had CFLAG been in the data set.

4) The first record displayed in a report has no "LAST" to compare to. The default here is that it is the first record IS the same as that non existant "LAST", hence using oyur techniques here, the first country will always be blue.

Hope this helps.


Robert F. Bowley Jr.
Owner
TaRa Solutions, LLC

In WebFOCUS since 2001
 
Posts: 132 | Location: Gadsden, Al | Registered: July 22, 2005Report This Post
Expert
posted Hide Post
You probably want the whole line with a new country in italic red, if so, you need to make one small change - add "CFLAG NOPRINT":

-SET &ECHO=ALL;

SET NODATA = ' ', HOLDLIST = PRINTONLY

TABLE FILE CAR
PRINT
COMPUTE CFLAG/A1 = IF COUNTRY EQ LAST COUNTRY THEN '0'
ELSE IF COUNTRY NE LAST COUNTRY THEN '1' ELSE '0';
CAR
MODEL
BODYTYPE
BY COUNTRY
ON TABLE HOLD AS FL1
END
-RUN

TABLE FILE FL1
PRINT
CFLAG NOPRINT
CAR
MODEL
BODYTYPE
BY COUNTRY
ON TABLE PCHOLD FORMAT EXL2K
ON TABLE SET HTMLCSS ON
ON TABLE SET STYLE *
UNITS=IN,
SQUEEZE=ON,
ORIENTATION=PORTRAIT,
$
TYPE=REPORT,
GRID=OFF,
FONT='ARIAL',
SIZE=9,
RIGHTGAP=0.125000,
$
TYPE=HEADING,
FONT='TIMES NEW ROMAN',
SIZE=12,
BACKCOLOR=RGB(255 255 153),
$
TYPE=HEADING,
LINE=1,
OBJECT=TEXT,
ITEM=1,
COLOR='GREEN',
STYLE=BOLD,
JUSTIFY=CENTER,
$
TYPE=DATA,
STYLE=ITALIC,
COLOR='RED',
BACKCOLOR='WHITE',
WHEN=CFLAG EQ '1',
$
TYPE=DATA,
STYLE=NORMAL,
COLOR='BLUE',
BACKCOLOR='WHITE',
WHEN=CFLAG EQ '0',
$
ENDSTYLE
-NOSTY
END
-RUN

The WHEN clause in the stylesheet requires that the referenced field be in the report NOPRINT or not.

In my many years of WebFOCUS coding I have never NEEDed to code a MACRO in a stylesheet - some people may prefer to but I don't.


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
 
Posts: 10577 | Location: Toronto, Ontario, Canada | Registered: April 27, 2005Report This Post
Master
posted Hide Post
Thanks to everyone for their answers!


Tomsweb
WebFOCUS 8.1.05M, 8.2.x
APP Studio, Developer Studio, InfoAssist, Dashboards, charts & reports
Apache Tomcat/8.0.36
 
Posts: 573 | Location: Baltimore, MD | Registered: July 06, 2006Report This Post
  Powered by Social Strata  

Read-Only Read-Only Topic

Focal Point    Focal Point Forums  Hop To Forum Categories  WebFOCUS/FOCUS Forum on Focal Point     style error in 7.69 [SOLVED]

Copyright © 1996-2020 Information Builders