Focal Point
[CLOSED] Tabs in Excel

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

March 09, 2010, 03:50 PM
nsk110483
[CLOSED] Tabs in Excel
Hi All,

I want to know how to code in the procedure to make the reports generated as tabs in Excel.

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


In Focus since 2008
WebFOCUS 8.2.0.1
Windows 7 - IE,Chrome,Firefox
Excel, PDF, HTML, AHTML, XML
JavaScript, jQuery, D3.js, Highcharts
March 09, 2010, 04:02 PM
Waz
Depending on whether you want to created tabs for different reports or for breaks in data, search for BYTOC or COMPOUND.


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!

March 10, 2010, 10:22 AM
Bobby
See syntax for compound, this has worked for me in the past:
TABLE FILE CAR
PRINT *
WHERE RECORDLIMIT EQ 1
ON TABLE PCHOLD FORMAT EXL2K OPEN 
ON TABLE SET STYLE *
TYPE=REPORT, TITLETEXT='Report1', $
ENDSTYLE
END
-RUN
TABLE FILE CAR
PRINT *
WHERE RECORDLIMIT EQ 2
ON TABLE PCHOLD FORMAT EXL2K OPEN 
ON TABLE SET STYLE *
TYPE=REPORT, TITLETEXT='Report2', $
ENDSTYLE
END
-RUN
TABLE FILE CAR
PRINT *
WHERE RECORDLIMIT EQ 3
ON TABLE PCHOLD FORMAT EXL2K CLOSE
ON TABLE SET STYLE *
TYPE=REPORT, TITLETEXT='Report3', $
ENDSTYLE
END  


hope this helps.


WebFOCUS 7.6.4
Windows
Excel, PDF, HTML
March 10, 2010, 10:32 AM
GinnyJakes
This is much simpler:
SET COMPOUND=BYTOC
TABLE FILE CAR
SUM SALES 
BY COUNTRY
BY CAR
ON TABLE PCHOLD FORMAT EXL2K
END



Ginny
---------------------------------
Prod: WF 7.7.01 Dev: WF 7.6.9-11
Admin, MRE,self-service; adapters: Teradata, DB2, Oracle, SQL Server, Essbase, ESRI, FlexEnable, Google
March 10, 2010, 11:45 AM
nsk110483
quote:

SET COMPOUND=BYTOC
TABLE FILE CAR
SUM SALES 
BY COUNTRY
BY CAR
ON TABLE PCHOLD FORMAT EXL2K
END


It is simple but it will generate 100 tabs if the By field has 100 values in it.


In Focus since 2008
WebFOCUS 8.2.0.1
Windows 7 - IE,Chrome,Firefox
Excel, PDF, HTML, AHTML, XML
JavaScript, jQuery, D3.js, Highcharts
March 10, 2010, 11:54 AM
Francis Mariani
Yes.

How many tabs are you expecting?


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 10, 2010, 11:57 AM
nsk110483
Also, my requirement is not from a single table, I want the tabs based on the field names of different tables, but used in the same report.
ex:
---
table A
---------
Field 1 | Field 2 | Field 3


Table B
---------
Field 4 | Field 5 | Field 6


Table C
---------
Field A | Field B


I want four excel tabs named,
1. Field 2
2. Field 4
3. Field 6
4. Field B


In Focus since 2008
WebFOCUS 8.2.0.1
Windows 7 - IE,Chrome,Firefox
Excel, PDF, HTML, AHTML, XML
JavaScript, jQuery, D3.js, Highcharts
March 10, 2010, 12:05 PM
GinnyJakes
Then use a concatenated key to do the sort.


Ginny
---------------------------------
Prod: WF 7.7.01 Dev: WF 7.6.9-11
Admin, MRE,self-service; adapters: Teradata, DB2, Oracle, SQL Server, Essbase, ESRI, FlexEnable, Google
March 10, 2010, 12:40 PM
nsk110483
quote:
Originally posted by GinnyJakes:
Then use a concatenated key to do the sort.


how to do that, can u explain with an example


In Focus since 2008
WebFOCUS 8.2.0.1
Windows 7 - IE,Chrome,Firefox
Excel, PDF, HTML, AHTML, XML
JavaScript, jQuery, D3.js, Highcharts
March 10, 2010, 05:20 PM
GinnyJakes
Your are not giving me much to go on. Are you joining the tables? Now that I look at your previous post, what you probably need to do, and this is a stab in the dark because I can't see your code, is to create a TABLE request for each view and use a define to create a generic sort field based on the value from that table. So for instance, table A would look something like this:
DEFINE FILE TABLEA
SORTFLD1/Ann=FIELD2;
END
TABLE FILE TABLEA
PRINT ...
BY SORTFLD1
...
ON TABLE HOLD AS HOLDA FORMAT ALPHA
END

Do something like this for each view. Then create your final output:
SET COMPOUND=BYTOC
TABLE FILE HOLDA
PRINT ...
BY SORTFLD1
ON TABLE PCHOLD FORMAT EXL2K
MORE
FILE HOLDB
MORE
FILE HOLDC
END


Please experiment with this shell to get it to do what you want. FYI, the MORE syntax concatentates the 3 hold files together assuming like fieldnames and formats. Look up either the MORE command or Universal Concatenation.


Ginny
---------------------------------
Prod: WF 7.7.01 Dev: WF 7.6.9-11
Admin, MRE,self-service; adapters: Teradata, DB2, Oracle, SQL Server, Essbase, ESRI, FlexEnable, Google