Focal Point
[SOLVED] EXL2K Compound and BYTOC

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

March 14, 2016, 11:23 AM
Francis Mariani
[SOLVED] EXL2K Compound and BYTOC
I was hoping to create a report in EXL2K format that is a Compound report with also BYTOC. I was hoping the Compound tab would be the last tab. It appears it must be the first tab.

This works (I get a report with six tabs - One named "Summary" and the other five named after the COUNTRY column):
TABLE FILE CAR
SUM
SALES
BY COUNTRY
ON TABLE PCHOLD FORMAT EXL2K OPEN
ON TABLE SET STYLE *
TYPE=REPORT, TITLETEXT='Summary', $
ENDSTYLE
END

TABLE FILE CAR
SUM
SALES
BY COUNTRY
ON TABLE PCHOLD FORMAT EXL2K BYTOC CLOSE
END


This does not work (I get a report with five tabs named after the COUNTRY column, I do not get the tab named "Summary"):
TABLE FILE CAR
SUM
SALES
BY COUNTRY
ON TABLE PCHOLD FORMAT EXL2K BYTOC OPEN
END

TABLE FILE CAR
SUM
SALES
BY COUNTRY
ON TABLE PCHOLD FORMAT EXL2K CLOSE
ON TABLE SET STYLE *
TYPE=REPORT, TITLETEXT='Summary', $
ENDSTYLE
END


I suppose there's nothing I can do about this.

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


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
March 14, 2016, 11:49 AM
Wep5622
I seem to recall that works with format XLSX. I think we're even using that in a report, but I can't for the life of me remember which one...


WebFOCUS 8.1.03, Windows 7-64/2008-64, IBM DB2/400, Oracle 11g & RDB, MS SQL-Server 2005, SAP, PostgreSQL 11, Output: HTML, PDF, Excel 2010
: Member of User Group Benelux :
March 14, 2016, 12:03 PM
BabakNYC
Wep5622 is right. I just tried your second example with XLSX in 8105 and got the Summary tab.


WebFOCUS 8206, Unix, Windows
March 14, 2016, 12:09 PM
Francis Mariani
I just tried this in WF 8.0.08 and it works. I will continue to test with my real world program that has styling that includes cell borders.

XLSX is not in the WF 8.0.08 documentation.


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
March 14, 2016, 12:16 PM
Francis Mariani
As I suspected, in WF 8.0.08, the styling that works for EXL2K does not work for XLSX.


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
March 15, 2016, 02:18 PM
Glenn C.
Francis,

With the above example did you get 2 reports on one excel tab per country? I am currently working with a similar situation. I have tried every OPEN/CLOSE/NOCLOSE combination I can think of and I either get only the first report per tab or the second report per tab but not both per tab. In some combinations (like if I leave a BYTOC off the first report) it just errors out (too many messages).
Not sure if I'm missing something.


WebFOCUS 7.7.03
Windows
all output (Excel, HTML, PDF)
March 15, 2016, 02:25 PM
Francis Mariani
Glenn, I get one tab per country and one summary tab.

Can you repro something using the CAR file?


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
March 15, 2016, 02:30 PM
Francis Mariani
I don't think there's a way to create an Compound Excel workbook with two reports per tab for each country using BYTOC to burst by country. But there is another way...

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
March 15, 2016, 02:48 PM
Francis Mariani
Compound Excel report with multiple reports per tab:

SET HOLDLIST=PRINTONLY
SET PAGE=NOPAGE
-RUN

-* determine the dimensions to process
TABLE FILE CAR
SUM
COUNTRY
BY COUNTRY NOPRINT
ON TABLE HOLD AS HCOUNTRY
END
-RUN

-SET &NBR_COUNTRY = &LINES;

-* create compound excel workbook - two reports for each dimension

-REPEAT END_REPEAT FOR &J FROM 1 TO &NBR_COUNTRY STEP 1

-READFILE HCOUNTRY

-SET &COMPOUND_STATE1 = IF &J EQ 1 THEN 'OPEN NOBREAK' ELSE 'NOBREAK';
-SET &COMPOUND_STATE2 = IF &J EQ &NBR_COUNTRY THEN 'CLOSE' ELSE '';

-* report 1
TABLE FILE CAR
SUM
SALES
BY MODEL
WHERE COUNTRY EQ '&COUNTRY'
HEADING
"REPORT 1 FOR <COUNTRY"
ON TABLE PCHOLD FORMAT EXL2K &COMPOUND_STATE1
ON TABLE SET STYLE *
TYPE=REPORT, TITLETEXT='&COUNTRY', $
END
-RUN

-* report 2
TABLE FILE CAR
SUM
SALES
BY CAR
WHERE COUNTRY EQ '&COUNTRY'
HEADING
" "
"REPORT 2 FOR <COUNTRY"
ON TABLE PCHOLD FORMAT EXL2K &COMPOUND_STATE2
END
-RUN

-END_REPEAT



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
March 17, 2016, 09:52 AM
Glenn C.
Thanks Francis.

I thought the answer would be along those lines. I was really hoping there might be something else I was missing.

I'll give it a try and let you know how I make out.


WebFOCUS 7.7.03
Windows
all output (Excel, HTML, PDF)