Focal Point
[SOLVED] Manipulate BYTOC output

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

August 26, 2014, 12:58 PM
JRS
[SOLVED] Manipulate BYTOC output
WF 7.7.03

OS/Oracle

Windows

Hello,

I'm trying to modify and existing report that uses BYTOC. What I need is another excel tab added to the report that is basically all inclusive of the tab reports created using BYTOC.

My code for example:
TABLE FILE Users
PRINT USER_DESC AS 'User Name'
USER_ID
ACTIVE
DOMAIN_DESC
BY GROUP_DESC NOPRINT
BY USER_DESC NOPRINT
BY DOMAIN_DESC NOPRINT
WHERE GROUP_DESC CONTAINS 'MSN'

****
$
ENDSTYLE
ON TABLE SET BYDISPLAY ON
ON TABLE PCHOLD FORMAT EXL2K
END

The result produces a spreadsheet with multiple reports separated by Group_DESC. I need another tab added to this report that will only by Domain_desc. I appreciate any help on this!!!!! :-\

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


7.7.03

OS/Oracle

Windows
Output:All
August 26, 2014, 03:04 PM
j.gross
For Excel (.xlsx) output, you can combine several TABLE requests via SET COMPOUND = OPEN / BREAK / CLOSE, where each TABLE request has PCHOLD ... FORMAT XLSX or equivalent, even if one of the requests uses ON TABLE SET COMPOUND 'BYTOC 1' to populate multiple tabs.

Make sure the non-BYTOC requests specify TITLETEXT, such that all the worksheet names will be unique.

There is documentation to the contrary, but apparently the limitation on combining COMPOUND and BYTOC does not apply to Excel outout.
August 26, 2014, 04:21 PM
JRS
Thank you J.GROSS. Do you mind elaborating just alittle more. I ran into a few errors with my first table file request. Please see below:

ON TABLE SET HTMLCSS ON
ON TABLE PCHOLD FORMAT EXL2K
ON TABLE SET COMPOUND EQ OPEN
END
-RUN
-*****Report 2 ***************
DEFINE FILE USER

My request did not like the word "OPEN" above?


7.7.03

OS/Oracle

Windows
Output:All
August 26, 2014, 04:29 PM
JRS
I also tried the following for report1 unsuccessful.


ON TABLE SET HTMLCSS ON
ON TABLE PCHOLD FORMAT EXL2K
ON TABLE SET COMPOUND BYTOC
ON TABLE SET COMPOUND EQ OPEN
END
-RUN
-*****Report 2 ************ ********
DEFINE FILE RUSER


7.7.03

OS/Oracle

Windows
Output:All
August 26, 2014, 04:49 PM
Tom Flynn
EXL2K:
  
APP PREPENDPATH IBISAMP
SET BYDISPLAY = ON 
TABLE FILE CAR
SUM
   RETAIL_COST 
   DEALER_COST
 BY COUNTRY
  ON TABLE PCHOLD FORMAT EXL2K OPEN
END
-RUN
TABLE FILE CAR
PRINT
  RETAIL_COST
  DEALER_COST
 BY COUNTRY
 BY CAR
  ON TABLE PCHOLD FORMAT EXL2K BYTOC
END
-EXIT


EXL07/XLSX:
 
APP PREPENDPATH IBISAMP
SET BYDISPLAY = ON 
TABLE FILE CAR
SUM
   RETAIL_COST 
   DEALER_COST
 BY COUNTRY
  ON TABLE PCHOLD FORMAT XLSX OPEN
ON TABLE SET STYLE *
TYPE=REPORT, TITLETEXT = 'Summary',$
ENDSTYLE
END
-RUN
TABLE FILE CAR
PRINT
  RETAIL_COST
  DEALER_COST
 BY COUNTRY
 BY CAR
  ON TABLE PCHOLD FORMAT XLSX BYTOC
END
-RUN
TABLE FILE CAR
SUM
  COUNTRY NOPRINT
  CAR NOPRINT
WHERE RECORDLIMIT EQ 1;
HEADING
"Company Name"
"IBI Car Summary / Detail Report"
"Run Date:<+0>&DATEtrMDYY"
ON TABLE PCHOLD FORMAT XLSX CLOSE
ON TABLE SET HTMLCSS ON
ON TABLE SET STYLE *
TYPE=REPORT, FONT=ARIAL, TITLETEXT='Parameters', $
TYPE=HEADING,  HEADALIGN=BODY, STYLE=BOLD, $
TYPE=HEADING, LINE=1, JUSTIFY=CENTER, COLSPAN=4,$
TYPE=HEADING, LINE=2, JUSTIFY=CENTER, COLSPAN=4,$
TYPE=HEADING, ITEM=2, COLOR=RED, STYLE=BOLD,$
TYPE=REPORT, WRAP=OFF,$
ENDSTYLE
END
-RUN
-EXIT



Tom Flynn
WebFOCUS 8.1.05 - PROD/QA
DB2 - AS400 - Mainframe
August 26, 2014, 06:14 PM
Waz
JRS,

If you are interested, this is alink to an earlier post that has code that creates links to other tabs in Excel (EXL2K)

http://forums.informationbuild...857072026#2857072026


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!

August 27, 2014, 11:29 AM
JRS
quote:
TYPE=REPORT, TITLETEXT = 'Summary',$


I really appreciate your help Tom and Waz! I was able to get the report to work. What was confusing to me by reading the documentation on Compound reports and also looking at similar PDF reports we have already developed. I noticed with the excel compound report there is no need to use a SET COMPOUND = ON at the beginning of the fex or
SET COMPOUND = OFF at the end of the last fex. Yesterday this was causing only one report to be produced. Also I noticed today that for a compound excel report that has a BYTOC included, that the report must be last. It also seems that since my last fex was a BYTOC it seems that the BYTOC acts like a SET COMPOUND = OFF???


7.7.03

OS/Oracle

Windows
Output:All
August 27, 2014, 02:37 PM
JRS
SOLVED!


7.7.03

OS/Oracle

Windows
Output:All
August 27, 2014, 05:32 PM
Waz
JRS,

Pleasse edit your first post in this thread and change the title to add [SOLVED].

Also I would strongly suggest that if you have multiple TABLE FILEs going into one Excel, you use the COMPOUND commands, even if the report works witout them, as future code tightening could make this report fail on a future release of WebFOCUS.

I would like to see this code that creates a compound document without compound commands, if its possible.


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!

September 02, 2020, 04:22 PM
Tracie Jones
I am trying to get an empty tab to show when no data exists for the value in my BY statement. I tried the EMPTYREPORT = ANSI and it did not work.


tbj
Prod WF 8.1.05,Test WF 8.1.05, WINDOWS 7 Platform, Oracle 12
Excel, PDF, Alpha