Focal Point
[SOLVED] Styling ACROSS RECOMPUTE's

This topic can be found at:
https://forums.informationbuilders.com/eve/forums/a/tpc/f/7971057331/m/598107341

June 08, 2009, 09:39 AM
Craig Kozlow
[SOLVED] Styling ACROSS RECOMPUTE's
Hello,

I have a need to do a RECOMPUTE, as opposed to a ROW-TOTAL, in my ACROSS report. The examples below result in the same totals whether I use ROW-TOTAL or RECOMPUTE, but my question is how does one style a RECOMPUTE in an ACROSS report.

This works...

TABLE FILE CAR
SUM RCOST
BY COUNTRY
ACROSS CAR ROW-TOTAL
ON TABLE SET STYLE *
TYPE=DATA, COLUMN=ROWTOTAL, COLOR=RED,$
ENDSTYLE
END

These don't...

TABLE FILE CAR
SUM RCOST
BY COUNTRY
ACROSS CAR RECOMPUTE
ON TABLE SET STYLE *
TYPE=DATA, COLUMN=ROWTOTAL, COLOR=RED,$
ENDSTYLE
END

TABLE FILE CAR
SUM RCOST
BY COUNTRY
ACROSS CAR RECOMPUTE
ON TABLE SET STYLE *
TYPE=DATA, COLUMN=RECOMPUTE, COLOR=RED,$
ENDSTYLE
END

No errors, the RECOMPUTEd column just doesn't style.

The ACROSS columns can vary from 1 to 8, so positional styling won't work without some fancy DM code, which I'm trying to avoid for the clients sake. This seems easy, just can't find it documented anywhere. Thanks!

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


PROD:WebFOCUS 7.6.11 on UNIX accessing FOCUS, Oracle, SQLServer
TEST: WebFOCUS 7.7.1 on UNIX accessing FOCUS, Oracle, SQLServer
June 08, 2009, 09:49 AM
Francis Mariani
SUMMARIZE and RECOMPUTE are styled with the SUBTOTAL tag.


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
June 08, 2009, 10:35 AM
Craig Kozlow
Francis,

SUBTOTAL styling works fine for column RECOMPUTES (BY statements), just not ACROSS RECOMPUTES.

TABLE FILE CAR
SUM RCOST
BY COUNTRY RECOMPUTE
ACROSS CAR RECOMPUTE
ON TABLE SET STYLE *
TYPE=SUBTOTAL, COLOR=RED,$
ENDSTYLE
END


Do you have an example of something that may work, if I'm not reading your reply correctly?


PROD:WebFOCUS 7.6.11 on UNIX accessing FOCUS, Oracle, SQLServer
TEST: WebFOCUS 7.7.1 on UNIX accessing FOCUS, Oracle, SQLServer
June 08, 2009, 12:09 PM
Francis Mariani
Craig,

Sorry about that - I fired off my response without testing a fex with ACROSS.

DevStudio v7.6.8 removes the RECOMPUTE statement in the ACROSS when viewing the code in Report Painter which suggests it doesn't know what to do with it or that ACROSS RECOMPUTE is not supported (even though it works). Unfortunately I don't think you can style the RECOMPUTE column through normal means.

I have created the recomputed column-total in other ways which then can be styled. I hope someone has a better idea, because this is ugly, but here goes:

TABLE FILE CAR
SUM
COMPUTE FIELD1T/D10 = ( RETAIL_COST - DEALER_COST ) / DEALER_COST * 100;
AS 'TOTAL'
BY COUNTRY
SUM
COMPUTE FIELD1/D10 = ( RETAIL_COST - DEALER_COST ) / DEALER_COST * 100;
AS ''
BY COUNTRY
ACROSS CAR

ON COUNTRY RECOMPUTE AS 'TOTAL'

ON TABLE SET STYLE *
TYPE=SUBTOTAL, COLOR=RED,$
TYPE=SUBTOTAL, COLUMN=FIELD1T, COLOR=GREEN,$
TYPE=REPORT, COLUMN=FIELD1T, COLOR=GREEN, SEQUENCE=99, $
ENDSTYLE
END

The SEQUENCE tag positions the recomputed column total as the last column in the report. Unfortunately, it also breaks the row-total line into two, which may be corrected by other ugly coding.


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
June 08, 2009, 12:38 PM
Francis Mariani
If the number of rows is consistent, you could try styling the specific column:

TABLE FILE CAR
SUM RCOST
BY COUNTRY RECOMPUTE
ACROSS CAR RECOMPUTE
ON TABLE SET STYLE *
TYPE=SUBTOTAL, COLOR=RED, $
TYPE=SUBTOTAL, COLUMN=P12, COLOR=GREEN, $
TYPE=REPORT, COLUMN=P12, COLOR=GREEN,$
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
June 08, 2009, 01:01 PM
Craig Kozlow
Francis,

You're absolutely right about 7.6.8 removing the ACROSS RECOMPUTE from the Report Painter, but it does still work.

Thanks for your input. Your last post was food for thought. I just had to figure out the last column of the report. So, this works and it's enough DM for the client to understand (which was one of their goals) ...

TABLE FILE CAR
BY CAR
ON TABLE HOLD AS JUNK
END
-RUN
-SET &COL = &LINES + 2;

TABLE FILE CAR
SUM RCOST
BY COUNTRY RECOMPUTE
ACROSS CAR RECOMPUTE
ON TABLE SET STYLE *
TYPE=REPORT, COLUMN=P&COL, COLOR=GREEN,$
ENDSTYLE
END

Thanks!


PROD:WebFOCUS 7.6.11 on UNIX accessing FOCUS, Oracle, SQLServer
TEST: WebFOCUS 7.7.1 on UNIX accessing FOCUS, Oracle, SQLServer
June 08, 2009, 01:26 PM
Francis Mariani
Craig, you have a good solution.


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