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     [CLOSED] Conditional background color in acrossvalue

Read-Only Read-Only Topic
Go
Search
Notify
Tools
[CLOSED] Conditional background color in acrossvalue
 Login/Join
 
<turtle>
posted
Hello,
I am creating a report in 5.2.5 and would like to change the background color of an alphanumeric acrossvalue based on the text in it. Here is a faulty snippet that only works the way I would like with certain data:

TYPE=ACROSSVALUE,
COLUMN=N3,
BACKCOLOR='RED',
STYLE=BOLD,
$

What I want to do is have the bkg color be red if the value of the data in it is 'RED', or orange if the data is 'ORANGE', etc. Is this possible, and if so, how?

Thanks in advance.

This message has been edited. Last edited by: Kerry,
 
Report This Post
Expert
posted Hide Post
I second the motion! we've asked for that feature. The only way now is the hard way.
doing it by hand coding and specific references.
This way, of course, won't work, if your across values vary in content.
So you could open a case in TechSupport, that will encourage programming to fix this.
 
Posts: 3811 | Location: Manhattan | Registered: October 28, 2003Report This Post
Gold member
posted Hide Post
I believe you can just add the statement WHERE FIELDNAME=RED, into your logic and it would turn the font color red for those. You would have to do a line for each color that you want, however.

For example.
TYPE=ACROSSVALUE,COLUMN=N3, WHERE FIELDNAME='RED', BACKCOLOR='RED',STYLE=BOLD,$
TYPE=ACROSSVALUE,COLUMN=NE, WHERE FIELDNAME='ORANGE', BACKCOLOR='ORANGE',STYLE=BOLD, $
 
Posts: 90 | Registered: April 15, 2004Report This Post
<Pietro De Santis>
posted
The code should use WHEN not WHERE:



TYPE=ACROSSVALUE,COLUMN=N3, WHEN FIELDNAME='RED', BACKCOLOR='RED',STYLE=BOLD,$
TYPE=ACROSSVALUE,COLUMN=NE, WHEN FIELDNAME='ORANGE', BACKCOLOR='ORANGE',STYLE=BOLD, $

Still don't know if this would work.

This message has been edited. Last edited by: <Mabel>,
 
Report This Post
Expert
posted Hide Post
TYPE=ACROSSVALUE,COLUMN=N12 BACKCOLOR=SILVER,WHEN=ORDER EQ 9,$

IF this feature did in fact work, WHICH IT DOES NOT, YET, then 'when' syntax would be as above,
'WHEN=ORDER EQ 9'
... not ...
'WHEN ORDER = 9'
However, ibi's brian carter has promised to escalate this oft-requested patch.
 
Posts: 3811 | Location: Manhattan | Registered: October 28, 2003Report This Post
Member
posted Hide Post
Is conditional background color in acrossvalues available yet?
mpb
 
Posts: 3 | Registered: March 30, 2007Report This Post
Virtuoso
posted Hide Post
TYPE=DATA,COLOR='RED',ACROSSCOLUMN=N1,WHEN=AMOUNT LT 0, $

This works...but I don't know what release your are on...please update your signiture...and good going for searching for the answer first.


In Focus since 1993. WebFOCUS 7.7.03 Win 2003
 
Posts: 1903 | Location: San Antonio | Registered: February 28, 2005Report This Post
Virtuoso
posted Hide Post
I have a report that has an ACROSS the colors the background dynamically. It applies the condition for every row/column. Is this what you are trying to do or are you wanting to do format a specific column only?


Thanks!

Mickey

FOCUS/WebFOCUS 1990 - 2011
 
Posts: 995 | Location: Gaithersburg, MD, USA | Registered: May 07, 2003Report This Post
Expert
posted Hide Post
I just cannot understand why this minimalist code doesn't work:

TABLE FILE CAR
SUM
SALES
BY COUNTRY
ACROSS SEATS

ON TABLE SET STYLESHEET *
TYPE=REPORT, ACROSSCOLUMN=SALES, BACKCOLOR=SILVER, WHEN= SEATS EQ 4,$
END


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
Gold member
posted Hide Post
Hi,

I need conditional bacground color when using ACROSS and OVER comand to assign color to specific ACROSSVALUE. The ACORSSVALUE are shown at the title area, not the data area.

The solution from the previous case (Case: 91541116 ) did help me of counting the column when using ACROSS with multiple OVER phrases. I need to assign color to a specific ACROSSVALUE such as when it is JAPAN or ITALY, but the COLUMN number of those in my report various from time to time. How do I get it to work without using the COLUMN=N1 technique?

Here is the solution provided by Case: 91541116:

TABLE FILE CAR
SUM SALES
OVER SEATS
OVER DCOST
ACROSS COUNTRY
ON TABLE SET STYLE *
TYPE=ACROSSVALUE,COLUMN=N10,COLOR=YELLOW,$
TYPE=ACROSSVALUE,COLUMN=N7,COLOR=RED,$
END

I am using 7.6.11.
thanks,


WebFOCUS 8.2.01 AppStudio
HTML, PDF, Excel
 
Posts: 61 | Registered: March 12, 2008Report This Post
Expert
posted Hide Post
Emily,

This is not the tech support site so quoting case numbers is not useful because only people registered on the tech support site with the site code used to raise the case would be able to see it (generally).

However, taking what I think your need is, try this approach -

TABLE FILE CAR
   SUM SALES
  OVER SEATS
  OVER DCOST
  OVER COMPUTE MYFLAG/A10 = COUNTRY; NOPRINT
ACROSS COUNTRY
ON TABLE SET HTMLCSS ON
ON TABLE SET PAGE NOLEAD
ON TABLE SET STYLE *
TYPE=DATA, WHEN=MYFLAG EQ 'ENGLAND',   ACROSSCOLUMN=N1, BACKCOLOR=YELLOW, $
TYPE=DATA, WHEN=MYFLAG EQ 'W GERMANY', ACROSSCOLUMN=N1, BACKCOLOR=RED, $
TYPE=DATA, WHEN=MYFLAG EQ 'JAPAN',     ACROSSCOLUMN=N2, BACKCOLOR=BLUE, $
TYPE=DATA, WHEN=MYFLAG EQ 'FRANCE',    ACROSSCOLUMN=N2, BACKCOLOR=AQUA, $
END

Instead of trying to trap the ACROSSVALUE I am associating it with each column individually by placing into a hidden cell of MYFLAG.

T



In FOCUS
since 1986
WebFOCUS Server 8.2.01M, thru 8.2.07 on Windows Svr 2008 R2  
WebFOCUS App Studio 8.2.06 standalone on Windows 10 
 
Posts: 5694 | Location: United Kingdom | Registered: April 08, 2004Report This Post
Gold member
posted Hide Post
Tony,
Thanks for your suggestion.
But your code give color to the data cell inside the table. My request is to get color at the column title section - for the word "JAPAN". I was also suggested to use 'ASNAMES =ON', however, I did not get it to work.

thanks,
Emily


WebFOCUS 8.2.01 AppStudio
HTML, PDF, Excel
 
Posts: 61 | Registered: March 12, 2008Report This Post
<FreSte>
posted
Emily,

I agree with you that this should be done in an easy way with the stylesheet-syntax, but as a workaround (and HTML-only Frowner ) you could do something like this:

-Fred-


DEFINE FILE CAR
  XCOUNTRY/A200 = 
    IF COUNTRY EQ 'JAPAN'  THEN '<span style="BACKGROUND-COLOR:SILVER; COLOR:RED;">'  | COUNTRY | '</span> ' ELSE 
    IF COUNTRY EQ 'FRANCE' THEN '<span style="BACKGROUND-COLOR:GREEN;  COLOR:#FFF;">' | COUNTRY | '</span> ' ELSE 
    COUNTRY;
END

TABLE FILE CAR
  SUM 
    SALES OVER
    SEATS OVER
    DCOST OVER
    ACROSS COUNTRY NOPRINT
    ACROSS XCOUNTRY AS COUNTRY
END
-RUN
 
Report This Post
Expert
posted Hide Post
Emily,

My apologies, I obviously misunderstood what you were trying to explain.

Fred's method is probably best if you only require HTML. For anything else you'll have to think about pre-parsing the data set to ascertain column notation.

T



In FOCUS
since 1986
WebFOCUS Server 8.2.01M, thru 8.2.07 on Windows Svr 2008 R2  
WebFOCUS App Studio 8.2.06 standalone on Windows 10 
 
Posts: 5694 | Location: United Kingdom | Registered: April 08, 2004Report This Post
Expert
posted Hide Post
Just in case you do not understand what I mean by pre-parsing, then this should help -
-DEFAULT &Rows = 3;
TABLE FILE CAR
  SUM COMPUTE COUNT/P2 = IF LAST COUNT EQ 0 THEN 1 ELSE LAST COUNT + &Rows; NOPRINT
      COMPUTE COLUMN_NOT/A5 = 'N' || LJUST(2,PTOA(COUNT,'(P2)','A2'),'A2'); NOPRINT
      COMPUTE COUNTRY_CLR/A10 = DECODE COUNTRY ('ENGLAND' 'RED' 'FRANCE' 'YELLOW' 'ITALY' 'GREEN' 'W GERMANY' 'BLUE' ELSE 'AQUA'); NOPRINT
      COMPUTE STYLE_LINE/A80 = 'TYPE=ACROSSVALUE,COLUMN='||COLUMN_NOT||',BACKCOLOR='||COUNTRY_CLR||',$';
   BY COUNTRY NOPRINT
ON TABLE SET HOLDLIST PRINTONLY
ON TABLE SAVE AS STYLEFEX FORMAT ALPHA
END
-RUN
TABLE FILE CAR
   SUM SALES
  OVER SEATS
  OVER DCOST
ACROSS COUNTRY
ON TABLE SET STYLE *
-INCLUDE STYLEFEX
END

T



In FOCUS
since 1986
WebFOCUS Server 8.2.01M, thru 8.2.07 on Windows Svr 2008 R2  
WebFOCUS App Studio 8.2.06 standalone on Windows 10 
 
Posts: 5694 | Location: United Kingdom | Registered: April 08, 2004Report This Post
<FreSte>
posted
Tony,
Very nice technique
Good One
 
Report This Post
Virtuoso
posted Hide Post
Try this:

TABLE FILE CAR
 SUM COUNTRY
   OVER SALES
   OVER SEATS
   OVER DCOST
 ACROSS COUNTRY NOPRINT
 ON TABLE SET STYLE *
  TYPE=DATA, STYLE=BOLD, ACROSSCOLUMN=COUNTRY, BACKCOLOR=RED,    WHEN=COUNTRY EQ 'ITALY', $
  TYPE=DATA, STYLE=BOLD, ACROSSCOLUMN=COUNTRY, BACKCOLOR=YELLOW, WHEN=COUNTRY EQ 'JAPAN', $
 ENDSTYLE
END


WebFOCUS 7.7.05
 
Posts: 1213 | Location: Seattle, Washington - USA | Registered: October 22, 2007Report This Post
Gold member
posted Hide Post
FreSte, Tony and Dan,
Thank you all very much for your suggestions.
Dan's suggestion will push the columns heading to the data section. Tony's idea is good too. My co-worker also found a solution, I would like to share with you. This solution is based on our special need - Show cloumn headings of all countries even when the country does not have data. (in the example bellowed, USA does not have data for the reporting period) Here is the code:
TABLE FILE CAR
SUM
'CAR.BODY.SALES' OVER
'CAR.BODY.SEATS' OVER
'CAR.BODY.DEALER_COST'
ACROSS 'CAR.ORIGIN.COUNTRY'
COLUMNS ENGLAND AND FRANCE AND USA AND ITALY AND JAPAN AND 'W GERMANY' ON TABLE SET STYLE *
TYPE=ACROSSVALUE,ACROSS=1,COLUMN=N1,BACKCOLOR='GREEN',$
TYPE=ACROSSVALUE,ACROSS=1,COLUMN=N4,BACKCOLOR='BLUE',$
TYPE=ACROSSVALUE,ACROSS=1,COLUMN=N7,BACKCOLOR='YELLOW',$
TYPE=ACROSSVALUE,ACROSS=1,COLUMN=N10,BACKCOLOR='RED',$
TYPE=ACROSSVALUE,ACROSS=1,COLUMN=N13,BACKCOLOR='ORANGE',$
TYPE=ACROSSVALUE,ACROSS=1,COLUMN=N16,BACKCOLOR='GREY',$
ENDSTYLE
END
-RUN


WebFOCUS 8.2.01 AppStudio
HTML, PDF, Excel
 
Posts: 61 | Registered: March 12, 2008Report 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     [CLOSED] Conditional background color in acrossvalue

Copyright © 1996-2020 Information Builders