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.

New TIBCO Community Coming Soon
In early summer, TIBCO plans to launch a new community—with a new user experience, enhanced search, and expanded capabilities for member engagement with answers and discussions! In advance of that, the current myibi community will be retired on April 30. We will continue to provide updates here on both the retirement of myibi and the new community launch.

What You Need to Know about Our New Community
We value the wealth of knowledge and engagement shared by community members and hope the new community will continue cultivating networking, knowledge sharing, and discussion.

During the transition period, from April 20th until the new community is launched this summer, myibi users should access the TIBCO WebFOCUS page to engage.


Focal Point    Focal Point Forums  Hop To Forum Categories  WebFOCUS/FOCUS Forum on Focal Point     [CLOSED] Using the value from a field in a stylesheet.

Read-Only Read-Only Topic
Go
Search
Notify
Tools
[CLOSED] Using the value from a field in a stylesheet.
 Login/Join
 
Member
posted
Hi,

I am trying to use the value in a field in our table to assign the color of a row.

This is what I have:

 
TABLE FILE RPTDATA
 PRINT NAME TYPE COLOR
 BY TYPE NOPRINT
  ON TABLE HOLD AS JUNK FORMAT PDF
  ON TABLE SET STYLE *
   TYPE=DATA, BACKCOLOR=RGB(COLOR),COLOR=RGB(000 000 000), $
  ENDSTYLE
END
-RUN   
 


Of course that gives me an error:
FOC3202) BAD VALUE IN STYLESHEET FILE AT LINE 40: BACKCOLOR=RGB(COLOR)


THe Color field is in the correct format: 245 235 215.

I could have sworn this worked in the past, but I can't find anything to support it.

Thoughts?

Thanks

This is on WF 8.0.0.5

This message has been edited. Last edited by: <Kathryn Henning>,


WebFOCUS 7.6 - Windows
Output formats: HTML, Excel 2000, PDF, Active HTML
 
Posts: 3 | Registered: January 04, 2013Report This Post
Expert
posted Hide Post
I wasn't aware of this working.

You will probably have to use a stylesheet line of each colour with a WHEN statement.


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
<FreSte>
posted
Waz is right.
Never seen this before, but the stylesheet lines can be generated for you like:


DEFINE FILE CAR
  NAME/A20  = COUNTRY;
  TYPE/A20  = CAR;
  COLOR/A12 = DECODE SEATS(
      1        '050 050 050'
      2        '050 150 250'
      4        '150 250 050'
      5        '222 111 000'
      DEFAULT  '111 000 200'
  );
  COLORLINES/A150 = 'TYPE=DATA, BACKCOLOR=RGB(' || COLOR || '), COLOR=RGB(000 000 000), WHEN=COLOR EQ ''' || COLOR || ''' ,$'; 
END

-* --- Generate STYLESHEET lines to include in report
TABLE FILE CAR
  BY COLORLINES
  ON TABLE HOLD AS HLDSTYLE FORMAT ALPHA
  ON TABLE SET HOLDLIST PRINTONLY
END
-RUN


TABLE FILE CAR
  PRINT 
    NAME 
    TYPE 
    COLOR
    SEATS
  BY TYPE NOPRINT
  ON TABLE SET PAGE NOPAGE
  ON TABLE SET HTMLCSS ON  
  ON TABLE SET STYLE *
    TYPE=REPORT     ,WRAP=OFF                                   ,$
    TYPE=REPORT     ,BORDER=1    ,BORDER-COLOR=RGB(210 210 210) ,$
    TYPE=REPORT     ,UNITS=PTS   ,FONT='VERDANA', SIZE=8        ,$
    TYPE=TITLE      ,STYLE=BOLD  ,BACKCOLOR=RGB(230 230 230)    ,$
    TYPE=DATA       ,TOPGAP=3    ,BOTTOMGAP=3                   ,$
-INCLUDE HLDSTYLE
ENDSTYLE
END



Cheers,

-Fred-
 
Report This Post
Guru
posted Hide Post
Using -READ or -READFILE as well.

DEFINE FILE CAR
CLR/A20='200 100 235';
END
TABLE FILE CAR
PRINT CLR COUNTRY CAR 
ON TABLE HOLD AS TEST
END
-RUN
-READ TEST, &CLR.A12.
-TYPE &CLR
TABLE FILE CAR
PRINT CLR COUNTRY CAR 
ON TABLE SET STYLE *
TYPE=DATA, BACKCOLOR=RGB(&CLR),$
ENDSTYLE
END  


-Rifaz

WebFOCUS 7.7.x and 8.x
 
Posts: 406 | Location: India | Registered: June 13, 2013Report This Post
Silver Member
posted Hide Post
SET HOLDLIST=PRINTONLY
RUN

TABLE FILE CAR
PRINT
COUNTRY
CAR
MODEL
DEALER_COST
COMPUTE DEAL_FLG/A1 = IF DEALER_COST GE 14000 THEN 'G'
ELSE IF DEALER_COST LT 5000 THEN 'R'
ELSE ' ';
COMPUTE DEAL_COST/A10 = FTOA(DEALER_COST, '(D7)', DEAL_COST); NOPRINT
 COMPUTE CMDECST/A500 = IF (DEAL_FLG EQ 'G') THEN ('</TD><TD CLASS=G1>' || DEAL_COST)
 ELSE IF (DEAL_FLG EQ 'R') THEN ('</TD><TD CLASS=R1>' || DEAL_COST)

ELSE ('</TD><TD CLASS=W1>' || DEAL_COST);
ON TABLE HOLD AS H001 FORMAT ALPHA
END
-RUN

TABLE FILE H001
PRINT
COMPUTE COLLINE/A6000 = '<TR><TD CLASS=W1>' || COUNTRY
|| '</TD><TD CLASS=W1>' || CAR
|| '</TD><TD CLASS=W1>' || MODEL
|| CMDECST
|| '</TD></TR>';
ON TABLE HOLD AS H002 FORMAT ALPHA
END
-RUN

-HTMLFORM BEGIN
<STYLE>
BODY { FONT-FAMILY: ARIAL; FONT-SIZE: .8EM; }
TD { FONT-SIZE: .8EM; BORDER-RIGHT: 1PX SOLID #CCC; }
TABLE { BORDER-COLLAPSE: COLLAPSE;
border:1px solid #CCC;
border-spacing: 0px;}
.W1 { COLOR: WHITE; }
.G1 { COLOR: GREEN; }
.R1 { COLOR: RED; }
.T1 { FONT-WEIGHT: BOLD; }
</STYLE>
<DIV ALIGN="CENTER">



<TABLE BORDER=0 bgcolor="#190B25">
<FONT COLOR="#FFFFFF" >!IBI.FIL.H002;</FONT>

</TABLE>

</DIV>
-HTMLFORM END

This message has been edited. Last edited by: Shakila Subhan,


WebFOCUS 8.0.08 - BI Portal, Developer Studio, App Studio, Excel, PDF, Active Formats and HTML5
Windows, All Outputs
 
Posts: 40 | Registered: April 02, 2014Report 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] Using the value from a field in a stylesheet.

Copyright © 1996-2020 Information Builders