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     [SOLVED] ACROSS, COMPUTE AND STYLES

Read-Only Read-Only Topic
Go
Search
Notify
Tools
[SOLVED] ACROSS, COMPUTE AND STYLES
 Login/Join
 
<José Andrés Vargas Aguilar>
posted
I have a code similar to this:

DEFINE FILE CAR
SALESD/D10 = SALES;
END
-***************************************
TABLE FILE CAR
SUM SALESD NOPRINT
BY COUNTRY NOPRINT
SUM SALESD NOPRINT
BY COUNTRY NOPRINT
BY CAR
SUM SALESD AS 'Sales'
PCT.SALESD/D6.2 WITHIN COUNTRY WITHIN SEATS AS '%'
BY COUNTRY NOPRINT
BY CAR
ACROSS SEATS
COMPUTE XTOT_SALESD/D15 = C2; AS 'Total'
COMPUTE PCT/D12.2 = C2 / C1 * 100; AS '%'
-***************************************
ON COUNTRY SUBHEAD
"COUNTRY: ON COUNTRY RECOMPUTE AS 'TOTAL'
ON TABLE NOTOTAL
END

My question is: how do you modify the style of the las two compute columns ('Total' and '%') from a stylesheet?

I already tried with all the types I know and found and I only manage to affect the other areas of the report but not that one in particular.

Thanks for the help.

This message has been edited. Last edited by: <José Andrés Vargas Aguilar>,
 
Report This Post
Expert
posted Hide Post
DEFINE FILE CAR
SALESD/D10 = SALES;
END

TABLE FILE CAR
SUM SALESD NOPRINT
BY COUNTRY NOPRINT
SUM SALESD NOPRINT
BY COUNTRY NOPRINT
BY CAR
SUM SALESD AS 'SALES'
PCT.SALESD/D6.2 WITHIN COUNTRY WITHIN SEATS AS '%'
BY COUNTRY NOPRINT
BY CAR
ACROSS SEATS
COMPUTE XTOT_SALESD/D15 = C2; AS 'TOTAL'
COMPUTE PCT/D12.2 = C2 / C1 * 100; AS '%'

ON COUNTRY SUBHEAD
"COUNTRY: <COUNTRY"
ON COUNTRY RECOMPUTE AS 'TOTAL'
ON TABLE NOTOTAL
ON TABLE SET STYLE *
TYPE=REPORT, COLUMN=XTOT_SALESD, COLOR=RED, $
TYPE=REPORT, COLUMN=PCT, COLOR=BLUE, STYLE=BOLD, $
ENDSTYLE
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
<José Andrés Vargas Aguilar>
posted
Thanks Francis, but actually I don't need to edit the results of the compute but the label associated to it. I.e. the 'Total and the '%'.

Thanks!
 
Report This Post
<José Andrés Vargas Aguilar>
posted
Here is a copy of my actual code for you to have a better idea.

This solution didn't work. What I need to "style" are the labels from the computes below the across ('Totales', 'Concent.', etc) and not the results itself...


-* *******************************************


TABLE FILE SQLOUT

SUM
MONTOS NOPRINT
CONMORA NOPRINT
MORA30 NOPRINT
CANTIDADES NOPRINT
CANTMORA NOPRINT
CANT30 NOPRINT

SUM
MONTOS NOPRINT
CONMORA NOPRINT
MORA30 NOPRINT
CANTIDADES NOPRINT
CANTMORA NOPRINT
CANT30 NOPRINT

BY &wf_agrupa

SUM
MONTOS AS 'Monto'
CONMORA NOPRINT
MORA30 NOPRINT
CANTIDADES AS 'Cant.'
CANTMORA NOPRINT
CANT30 NOPRINT

BY &wf_agrupa

ACROSS MORAMIN NOPRINT
ACROSS DIA AS 'Dias de Mora'
COMPUTE TVAL/D20.2 = C7; AS 'TOTALES'
COMPUTE TCAN/D20 = C10; AS 'TEST'
COMPUTE PVAL/D20.2% = 100*C7/C1; AS 'CONCENT.'
COMPUTE PCAN/D20.2% = 100*C10/C4; AS ''
COMPUTE CONM/D20.2% = 100*C8/C2; AS 'MORA'
COMPUTE CANM/D20.2% = 100*C11/C5; AS ''
COMPUTE MOR3/D20.2% = 100*C9/C3; AS 'MORA > 30'
COMPUTE CAN3/D20.2% = 100*C12/C6; AS ''

ON TABLE COLUMN-TOTAL

-INCLUDE bkw54/bkwstyleanalisis.fex


-* *******************************************


-* Amongst other stuff I have this on bkw54/bkwstyleanalisis.fex


-* *******************************************


TYPE=REPORT, COLUMN=TCAN, STYLE=BOLD, SIZE=12, BACKCOLOR=YELLOW, COLOR=NAVY,$

-* *******************************************

FYI, I initially thought this labels would be ACROSSTITLE or ACROSSVALUE but they dont get affected by the ACROSSTITLE and ACROSSVALUE definitions I already have.

I used the -HTMLFORM for CSS advice Francis gave me but it didn't do the job either.

Thanks for all the help, I really appreciate it!
 
Report This Post
Expert
posted Hide Post
José, it appears you want to style the column titles of the COMPUTE columns after the ACROSS columns.

Use TYPE=ACROSSVALUE, COLUMN=:

-*-- jose1

TABLE FILE CAR
SUM
SALES NOPRINT
SEATS NOPRINT
WIDTH NOPRINT
LENGTH NOPRINT
WHEELBASE NOPRINT
WEIGHT NOPRINT

SUM
SALES NOPRINT
SEATS NOPRINT
WIDTH NOPRINT
LENGTH NOPRINT
WHEELBASE NOPRINT
WEIGHT NOPRINT

BY MODEL

SUM
SALES AS 'Monto'
SEATS NOPRINT
WIDTH NOPRINT
LENGTH AS 'Cant.'
WHEELBASE NOPRINT
WEIGHT NOPRINT

BY MODEL

ACROSS COUNTRY NOPRINT
ACROSS BODYTYPE AS 'Dias de Mora'
COMPUTE TVAL/D20.2 = C7; AS 'TOTALES'
COMPUTE TCAN/D20 = C10; AS 'TEST'
COMPUTE PVAL/D20.2% = 100*C7/C1; AS 'CONCENT.'
COMPUTE PCAN/D20.2% = 100*C10/C4; AS ''
COMPUTE CONM/D20.2% = 100*C8/C2; AS 'MORA'
COMPUTE CANM/D20.2% = 100*C11/C5; AS ''
COMPUTE MOR3/D20.2% = 100*C9/C3; AS 'MORA > 30'
COMPUTE CAN3/D20.2% = 100*C12/C6; AS ''

ON TABLE COLUMN-TOTAL

ON TABLE SET STYLE *
TYPE=REPORT, FONT='Arial', SIZE=8, $
TYPE=ACROSSVALUE, COLUMN=TVAL, STYLE=BOLD, SIZE=10, BACKCOLOR=YELLOW, COLOR=NAVY,$
ENDSTYLE
END

This message has been edited. Last edited by: Francis Mariani,


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
Virtuoso
posted Hide Post
It took some experimentation, but this seems to work.

DEFINE FILE CAR
 SALESD/D10 = SALES;
END
-*
TABLE FILE CAR
 SUM SALESD NOPRINT
  BY COUNTRY NOPRINT
 SUM SALESD NOPRINT
  BY COUNTRY NOPRINT
  BY CAR
 SUM SALESD AS 'SALES'
     PCT.SALESD/D6.2 WITHIN COUNTRY WITHIN SEATS AS '%'
  BY COUNTRY NOPRINT
  BY CAR
  ACROSS SEATS
  COMPUTE XTOT_SALESD/D15 = C2; AS 'TOTAL'
  COMPUTE PCT/D12.2 = C2 / C1 * 100; AS '%'
  ON COUNTRY SUBHEAD
   "COUNTRY: <COUNTRY"
  ON COUNTRY RECOMPUTE AS 'TOTAL'
  ON TABLE NOTOTAL
  ON TABLE SET STYLE *
   TYPE=ACROSSVALUE, COLUMN=XTOT_SALESD, STYLE=BOLD, COLOR=RED, $
   TYPE=ACROSSVALUE, COLUMN=PCT, STYLE=BOLD, COLOR=BLUE, $
  ENDSTYLE
END


WebFOCUS 7.7.05
 
Posts: 1213 | Location: Seattle, Washington - USA | Registered: October 22, 2007Report This Post
Expert
posted Hide Post
I edited my message at 13:57, correcting my code because I determined that ACROSSVALUE works, even though the COMPUTEc column is not strictly an ACROSS column.


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
Expert
posted Hide Post
Dan, yes, ACROSSVALUE is the answer!


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
Virtuoso
posted Hide Post
Yes, but a minute too late! Maybe I should learn how to type with more than two fingers and one thumb?


WebFOCUS 7.7.05
 
Posts: 1213 | Location: Seattle, Washington - USA | Registered: October 22, 2007Report This Post
<José Andrés Vargas Aguilar>
posted
Guys, I'm terribly sorry to say this but it doesn't work.

I've been doing some testing myself and found out that whats inhibits both your codes is this set:

ON TABLE SET HTMLCSS ON

The easy thing would be to comment it but when doing so I loose the format of other stuff in my report.

At the end I did this really ugly trick:

ACROSS DIA AS 'Dias de Mora'
   COMPUTE TVAL/D20.2 = C7; AS '<style type="text/css">< !--b{ background-color:#93ACDB; font-size:10px; font-face:arial; text-align:center; color:#FFFFFF; border-top: 1.00pt RIDGE #808080; border-bottom: NONE; border-right: NONE; border-left: 1.00pt RIDGE #808080; }--></style>[b]<font color=#93ACDB>__</font>TOTALES<font color=#93ACDB>__</font>[/b]'
   COMPUTE TCAN/D20 = C10; AS ''
   COMPUTE PVAL/D20.2% = 100*C7/C1; AS '[b]<font color=#93ACDB>__</font>CONCENT.<font color=#93ACDB>__</font>[/b]'
   COMPUTE PCAN/D20.2% = 100*C10/C4; AS ''
   COMPUTE CONM/D20.2% = 100*C8/C2; AS '[b]<font color=#93ACDB>__</font>MORA<font color=#93ACDB>__</font>[/b]'
   COMPUTE CANM/D20.2% = 100*C11/C5; AS ''
   COMPUTE MOR3/D20.2% = 100*C9/C3; AS '[b]<font color=#93ACDB>__</font>MORA<font color=#93ACDB>_</font>><font color=#93ACDB>_</font>30<font color=#93ACDB>__</font>[/b]'
   COMPUTE CAN3/D20.2% = 100*C12/C6; AS ''


Which gives to the labels the styling I need. That would make it for the day.

Still, for some reason my boss wants it to be styled without making a direct reference to the column nor editing the label itself. In that fashion we could reuse the style file for other fex's without editing a fex's ACROSS-COMPUTE labels every time.

My guess is... that isn't possible, for this particular case.
What do you think?

Thanks for all your support!
 
Report This Post
Virtuoso
posted Hide Post
When I add ON TABLE SET HTMLCSS ON to the code, there is no change in the output and the COMPUTE column titles are still styled.


WebFOCUS 7.7.05
 
Posts: 1213 | Location: Seattle, Washington - USA | Registered: October 22, 2007Report This Post
Expert
posted Hide Post
quote:
I've been doing some testing myself and found out that whats inhibits both your codes is this set:

ON TABLE SET HTMLCSS ON


This is the danger of not telling us evrything up front - Dan and I have provided several working examples to your problem. Every time we post a solution, you add another twist. This gets a bit annoying.

The best way to get a proper answer is to create a fex we can all run - using Car, Gotham Grinds or Century Sales data sources. This fex should contain ALL the peculiarities of your real world program.

If you set HTMLCSS to ON, then you shouldn't be using CLASS= - it's not a good idea to mix the two. My preference is to NOT use HTMLCSS ON, and use CLASS= instead. You will have control over everything by assigning classes to each report component: headings, column titles, data, etc.


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
Expert
posted Hide Post
TABLE FILE CAR
SUM
LENGTH NOPRINT
WIDTH NOPRINT
SUM
SALES
ACROSS COUNTRY

COMPUTE COL1/D15.2 = C1 / C2;

ON TABLE HOLD AS H001 FORMAT HTMTABLE
ON TABLE SET STYLE *
TYPE=ACROSSVALUE, COLUMN=COL1, CLASS= x64, $
ENDSTYLE
END
-RUN

-HTMLFORM BEGIN
<html>
<head>
<TITLE>WEBFOCUS REPORT</TITLE>
<style type="text/css">
.x64 { font-family:ARIAL; font-size:7pt; font-weight:bold; color:#FFFFFF; background-color:#93ACDB; text-align:center;
border-top: 1.00pt RIDGE #808080; border-bottom: NONE; border-right: 1.00pt RIDGE #808080; border-left: 1.00pt RIDGE #808080; }
</style>
</head>
<BODY>
!IBI.FIL.H001;
</BODY>
</html>
-HTMLFORM 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
<José Andrés Vargas Aguilar>
posted
Thanks for all the help to both of you.

This issue is oficially over.

I'm disabling HTMLCSS, not using CLASS and using the ACROSSVALUE option you showed a few posts ago. Why? Because this report must work not only on HTML but also on PDF and XLS. And PDF doesn't support CSS.

Now I'll see how to get borders on the HEADING, which would be the only unsolved point. For this I plan to open a new thread if I don't manage to find the reason of it not working.

Francis, I'll consider your recomendations for future posts about creating a fex we can all use with a common data source that includes all the peculiarities of my problem. Thanks!
 
Report 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     [SOLVED] ACROSS, COMPUTE AND STYLES

Copyright © 1996-2020 Information Builders