Focal Point
[SOLVED] Printing 2 tables as a DOC format

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

August 16, 2018, 03:08 PM
ccollier
[SOLVED] Printing 2 tables as a DOC format
I am trying to print 2 tables as a DOC format.

 -*Table 1
TABLE FILE CAR
SUM 
    RETAIL_COST
BY  COUNTRY
BY  CAR
ON TABLE HOLD AS REPORT1 
END

TABLE FILE REPORT1
PRINT *
ON TABLE PCHOLD FORMAT HTML
END




-*Table 2
TABLE FILE EMPLOYEE
SUM 
     EMPLOYEE.EMPINFO.CURR_SAL
BY  EMPLOYEE.EMPINFO.EMP_ID
BY  EMPLOYEE.EMPINFO.LAST_NAME
BY  EMPLOYEE.EMPINFO.FIRST_NAME
BY  EMPLOYEE.EMPINFO.DEPARTMENT
ON TABLE SET PAGE-NUM NOLEAD
ON TABLE SET ASNAMES ON
ON TABLE NOTOTAL
ON TABLE SET HTMLEMBEDIMG ON
ON TABLE SET HTMLCSS ON
ON TABLE SET STYLE *
     INCLUDE = IBFS:/EDA/EDASERVE/_EDAHOME/ETC/warm.sty,
$
ENDSTYLE
ON TABLE HOLD AS REPORT2
END

TABLE FILE REPORT2
PRINT *
ON TABLE PCHOLD FORMAT HTML
END 


The code here holds both tables and prints them as HTML which will print both tables on the page. When I try to print both of them as DOC format, it only prints Table 1 and not Table 2. Is that a limitation of the DOC format or is there any way to print both files onto one DOC file?

This message has been edited. Last edited by: FP Mod Chuck,


WebFOCUS 8.2.01M on Windows 10
August 16, 2018, 03:27 PM
BabakNYC
I would add a -RUN after each report.


WebFOCUS 8206, Unix, Windows
August 17, 2018, 08:46 AM
Tony A
quote:
add a -RUN after each report

Not sure how that would achieve what is required apart from good practice?

Anyway, back to the question,

@CCollier,

You are essentially trying to create a document so you need to understand what formats you can use for such an output.

Unfortunately for you, DOC format is not one of those Frowner.

T



In FOCUS
since 1986
WebFOCUS Server 8.2.01M, thru 8.2.07 on Windows Svr 2008 R2  
WebFOCUS App Studio 8.2.06 standalone on Windows 10 
August 17, 2018, 08:48 AM
ccollier
So what you're saying is that there's no real way to combine the 2 into a DOC format because of the way that format works?


WebFOCUS 8.2.01M on Windows 10
August 17, 2018, 09:02 AM
BabakNYC
Tony A: It's like chicken soup...it couldn't hurt. Smiler

I just tried this and it seemed to work only in HTML. Neither PDF nor DOC will render the second report in the output. I agree that putting the output of several reports in one document makes sense. The only problem is it won't be in a format that'll open in MS Word.


WebFOCUS 8206, Unix, Windows
August 17, 2018, 09:34 AM
RSquared
try adding a OPEN on the first report and a CLOSE on the last report


WF 7.6.11
Oracle
WebSphere
Windows NT-5.2 x86 32bit
August 20, 2018, 09:27 AM
Frans
Because doc is a file, you first need to combine it in one file:

 
FILEDEF DOCFILE DISK docfile.doc (APPEND
TABLE FILE CAR BY COUNTRY
HEADING
"REPORT 1"
ON TABLE HOLD AS DOCFILE FORMAT DOC
END

TABLE FILE CAR BY COUNTRY
HEADING
"REPORT 2"
ON TABLE HOLD AS DOCFILE FORMAT DOC
END

EX EDAGET TXT, docfile.doc,T
 


P.s. for your HTML output it would also be better to use compound like RSquared suggested.


Test: WF 8.2
Prod: WF 8.2
DB: Progress, REST, IBM UniVerse/UniData, SQLServer, MySQL, PostgreSQL, Oracle, Greenplum, Athena.