Focal Point
[WORKAROUND] Microsoft Word Format

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

December 08, 2008, 12:54 PM
Doug
[WORKAROUND] Microsoft Word Format
I need a refresher on this... What's the best format to use for creating a COMPOUND Microsoft Word document, with TABLE and GRAPH output?

Thanks a Gig... In advance...

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




   In FOCUS Since 1983 ~ from FOCUS to WebFOCUS.
   Current: WebFOCUS Administrator at FIS Worldpay | 8204, 8206
December 08, 2008, 01:23 PM
<JG>
quote:
COMPOUND Microsoft Word document


Word documents are not a valid output format, compounded or not.

Use another compound format such as PDF.

If you must have WORD then you need to use a file converter such as ABC Amber.

Otherwise it's FILEDEF APPEND and FORMAT WP with no formatting.
December 08, 2008, 02:09 PM
Doug
Thanks JG,

That's what I was affraid of, I was hoping I needed a refresher to remind me of something that I was very hopeful was there... Bummer, it (MS Word format) is not there...

When will MS Word become an option? If at all? Why isn't it?




   In FOCUS Since 1983 ~ from FOCUS to WebFOCUS.
   Current: WebFOCUS Administrator at FIS Worldpay | 8204, 8206
December 08, 2008, 02:34 PM
Doug
Can a "file converter" such as "ABC Amber" be incorpoarted into WebFOCUS? I'm guessing: no.

Has anyone out there in the WebFOCUS World created a MS Word document via WebFOCUS?
December 08, 2008, 03:05 PM
<JG>
ABC Amber is a very cheap program suite and can be called from a WebFocus request as a command line call
(have a look, WebFocus can use it, no compettitor can [! del c:\*.*, that's the potential power of WebFOCUS
, If your system can allow that please look at your security.]).

-HTMLFORM to deliver.

If Word .DOC is a criticale requirement then you need to raise "yet another" NFR with IBI.

Or use a work around that is available.
December 08, 2008, 03:12 PM
Doug
Thanks again JG,

1) Output to MS Word is a Critical Requirment here.
2) I'm on Unix here. So, the bang works fine: "! ls -l" is available.
3) I'll look into the NFR and open a case on this accordingly. (I'll reference this thread as well)
December 08, 2008, 03:24 PM
<JG>
Doug, Unix, that's a bigger problem.

Windows file converters are two a penny, Unix to Microsoft doc also exist but I've never used any.

However I'm sure they are there and would work in exactly the same way.

Do a search on the unix forums for PDF to MS word convertion, Bound to get loads of hit's for freeware.
December 08, 2008, 04:44 PM
Doug
Thanks again for putting up with the "can of worms". I have spoken with someone who has produced a MS Word document from WebFOCUS, through an editable HTML page, and then (the user) saves the final output as MS Word.

I'll post more on this when I get it... I hope this works... If not, we may have to fall back to the COMPOUND PDF with edit capabilities.
December 09, 2008, 02:34 AM
Tony A
Doug,

Bearing in mind that all MS apps (allegedly!) can read the XML/MSO style output produced by doing FORMAT EXL2K, just FILEDEF your output file to disk and use a file extension of ".doc". Not compound I know but certainly a way forward that you might be able to work with.

T

-DEFAULT &WFFMT = 'EXL2K'
FILEDEF OUTPUT DISK c:\wf76\ibi\apps\baseapp\testing.doc
TABLE FILE CAR
SUM RCOST   AS 'Retail Cost'
    DCOST   AS 'Dealer Cost'
    SALES   AS 'Sales'
 BY COUNTRY AS 'Country of Origin'
 BY CAR     AS 'Manufacturer'
 BY MODEL   AS 'Model'
ON COUNTRY SUBTOTAL RCOST DCOST AS 'Total for '
HEADING
"WebFOCUS Output Testing"
"Date: &DATEDMtYY"
FOOTING
"Testing only"
ON TABLE HOLD AS OUTPUT FORMAT &WFFMT
ON TABLE SET HTMLCSS ON
ON TABLE SET PAGE NOLEAD
ON TABLE SET STYLE *
UNITS=IN, PAGESIZE='A4', LEFTMARGIN=0.19, RIGHTMARGIN=0.19, TOPMARGIN=0.00, BOTTOMMARGIN=0.00,
SQUEEZE=ON, ORIENTATION=LANDSCAPE,$
TYPE=REPORT, FONT='ARIAL', SIZE=8, COLOR=BLACK, BACKCOLOR='NONE', STYLE=NORMAL,
     TITLETEXT='BVT Colour palette testing', WRAP=ON, $
TYPE=DATA, SIZE=8,    $
TYPE=TITLE, BORDER=LIGHT, BORDER-COLOR=RGB(66 66 66), BACKCOLOR=RGB(092 149 150),
     COLOR=RGB(255 255 255), STYLE=-UNDERLINE+BOLD, $
TYPE=TITLE, SIZE=8, $
TYPE=HEADING, BORDER=LIGHT, BORDER-COLOR=RGB(66 66 66), SIZE=10, COLOR=RGB(255 255 255),
     BACKCOLOR=RGB(092 149 150), JUSTIFY=CENTER, HEADALIGN=INTERNAL,   $
TYPE=HEADING, LINE=1, COLOR=RGB(255 255 255), JUSTIFY=LEFT, $
TYPE=HEADING, LINE=2, COLOR=RGB(255 255 255), JUSTIFY=RIGHT, $
TYPE=SUBFOOT, COLOR=RGB(000 000 000), BACKCOLOR=RGB(191 201 211), BORDER=LIGHT,
     BORDER-COLOR=RGB(66 66 66), $
TYPE=SUBTOTAL, COLOR=RGB(000 000 000), BACKCOLOR=RGB(191 201 211), BORDER=LIGHT,
     BORDER-COLOR=RGB(66 66 66), $
TYPE=SUBTOTAL, SIZE=8,$
TYPE=ACROSSTITLE, COLOR=RGB(255 255 255), BACKCOLOR=RGB(094 167 208), STYLE=BOLD, $
TYPE=GRANDTOTAL, COLOR=RGB(255 255 255), BACKCOLOR=RGB(129 145 162), $
TYPE=FOOTING, BORDER=LIGHT, BORDER-COLOR=RGB(66 66 66), SIZE=10, COLOR=RGB(255 255 255),
     BACKCOLOR=RGB(092 149 150), JUSTIFY=CENTER,   $
ENDSTYLE
END
-RUN




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 
December 09, 2008, 05:58 AM
<JG>
Tony, got me thinking, no need to go to EXL2K

Use HTMTABLE and you can get compound documents with page-breaks if required.

 
SET HTMLFORMTYPE=DOC
-HTMLFORM BEGIN
!IBI.FIL.OUTPUT1;
<p style="page-break-before: always">
!IBI.FIL.OUTPUT2;
-HTMLFORM END
 

December 09, 2008, 08:31 AM
Tony A
Just goes to show the power of this forum Smiler

T
December 09, 2008, 09:41 AM
Doug
Oh "the power of this forum"... It's great because of the people that make it so...

I've incorporated the last two items, from Tony and JG, and am (hopefully) only one step away from "being there". That is, my images (!IBI.FIL.OUTPUT1Wink do not get saved when I "save as". Why Not? How can I get them in my saved file (myfile.html)?
December 09, 2008, 10:28 AM
<JG>
Doug, What images are you trying to insert?

Post a sample of the code you are using.
December 09, 2008, 11:14 AM
Doug
The images that I need to save when I do a "save as" of my HTML output are "GRAPH001" and "HPHC.gif", created in the following stripped down code.


GRAPH FILE CAR
SUM SALES
BY COUNTRY
ON GRAPH SET LOOKGRAPH VBAR
ON GRAPH SET BARNUMB OFF
ON GRAPH SET 3D OFF
ON GRAPH SET VZERO ON
ON GRAPH SET GRID ON
ON GRAPH SET VAXIS 400
ON GRAPH SET HAXIS 600
ON GRAPH HOLD AS GRAPH001 FORMAT HTMTABLE
END
-RUN
-HTMLFORM BEGIN
[Proper HTML tags for the IMG file: HPHC.gif]
!IBI.FIL.GRAPH001;
-HTMLFORM END

I removed much of the "extra" code as not to cloud the issue. The above code is as basic as I need for this sample.
Here's the full code which still does not have all the associated styles.

This message has been edited. Last edited by: Doug,
December 12, 2008, 08:49 AM
Doug
Tony, Your solution works fine (1) for a single TABLE FILE request (2) on my local machine.

1) The size of my output file doubles in size when I add a second TABLE FILE request (Duplicate of the orginal) after I add a second FILEDEF command, this time with the addition of "(APPEND", after the END / -RUN. However, I only see the results of the first TABLE FILE request when I open that file in MS Word. What's up with that?

2) My local machine is my standalone laptop which has everything on its C drive. So, I don't have any issues with accessing the WFC or WFRS.

Tanks again to you and JG (and anyone else who joins in)
December 12, 2008, 10:56 AM
<JG>
Doug,

Have not tested it but try filedefing the graph files with a .DOC extension as well
December 12, 2008, 02:39 PM
Doug
I'll check that out... Thanks... They've made it a bit easier and harder at the same time.

Easier: We do not create the entire Word doc, just the objects to be OLE'd into their templates.

Harder: 1) We need to update these objects via a fresh run of a fex by clicking on that object. 2) We need to insert an object at the current cursor location via a fresh run of a fex by clicking on a button on the toolbar.

Some of this sounds like the WebFOCUS Excel Add-in doesn't it. A NFR? Or, is that "in the works"?

*** Dec 14th: I tried the graph / doc suggestion to no avail... I'll consider this closed for now, till a NFR comes trough...

This message has been edited. Last edited by: Doug,
December 15, 2008, 03:47 AM
Tony A
Doug,

Apologies for not replying - time difference and the weekend!!

I did actually mention that it was not compound (and therefore a single document) and that you might be able to progress from there.

Looks like you've taken up the mantle and progressed anyway - did you raise an NFR via InfoResponse?

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 
December 15, 2008, 04:44 AM
<JG>
Doug, hold the graph to a location accessible to the webserver.
 
FILEDEF OUTPUT1 DISK OUTPUT1.DOC
FILEDEF OUTPUT2 DISK OUTPUT2.DOC
FILEDEF GRAPH1 DISK D:\IBI\APPS\BASEAPP\GRAPH1.GIF

-RUN
TABLE FILE CAR
PRINT COUNTRY
ON TABLE HOLD AS OUTPUT1 FORMAT HTMTABLE
END
-RUN
TABLE FILE CAR
PRINT COUNTRY CAR MODEL
ON TABLE HOLD AS OUTPUT2 FORMAT HTMTABLE
END
-RUN
GRAPH FILE CAR
SUM DCOST
ACROSS COUNTRY
ON TABLE HOLD AS GRAPH1 FORMAT GIF
END
-RUN
SET HTMLFORMTYPE=DOC
-HTMLFORM BEGIN
!IBI.FIL.OUTPUT1;
<P STYLE="PAGE-BREAK-BEFORE: ALWAYS">
<IMG SRC=http://wfserver/approot/baseapp/GRAPH1.GIF></IMG>
<P STYLE="PAGE-BREAK-BEFORE: ALWAYS">
!IBI.FIL.OUTPUT2;
-HTMLFORM END 

December 15, 2008, 02:57 PM
Doug
Tony: Thanks, I noticed the “not COMPOUND” comment (back on 12/9). I only used COMPOUND as a reference to the similarity to what I wanted and its similarity to the COMPOUND report functionality in PDF.

JG: Unfortunately, they do not want this in HTML. So the HTMTABLE is not applicable at this time.

I'll see what I can do about the NFR...
December 16, 2008, 02:31 AM
<JG>
quote:
SET HTMLFORMTYPE=DOC

Doug, using the above setting forces the web browser to open the outpt in Microsoft word.

If your browser is not configured to automatically open MS word documents it will propmt
you to open or save as a word document first.
December 16, 2008, 03:01 AM
Tony A
Doug,

Even though it "looks" like HTML output, don't forget that to see the "real" layout in the MS Word plugin within your browser, you should select view/print layout from the toolbar and then you should see it properly.

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 
December 17, 2008, 04:01 PM
Doug
JG: Yes, the "SET HTMLFORMTYPE=DOC" works well and MY browser is set to prompt (no telling what the users have their's set for). I will use this and Tony's info for a final product.

Tony: That's great. I'll use that as well... I will use this and JG's info for a final product.

Smiler -Doug
October 01, 2009, 12:20 PM
Francis Mariani
SET HTMLFORMTYPE=DOC
-HTMLFORM BEGIN 
!IBI.FIL.OUTPUT1;
<p style="page-break-before: always"> !IBI.FIL.OUTPUT2;
-HTMLFORM END

Just found this - really handy for something I'm doing right now!

The power of searching FocalPoint!

Thanks,


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
July 17, 2016, 06:59 PM
David Briars
quote:
Just found this - really handy for something I'm doing right now!

Same here.

Same technique as developed in this post, adding MS Word landscape and margin settings:

-* File MSWord.fex
SET PAGE = NOPAGE
-*
TABLE FILE CAR
"Car Report"
SUM RCOST
BY COUNTRY 
BY CAR 
BY MODEL
ON TABLE HOLD AS OUTPUT1 FORMAT HTMTABLE
ON TABLE SET STYLE *
 INCLUDE = endeflt, $
 TYPE=TITLE, JUSTIFY=CENTER,$
ENDSTYLE
END
-RUN
-*
TABLE FILE GGSALES
"Sales Report"
SUM DOLLARS
BY REGION
BY ST
ON TABLE HOLD AS OUTPUT2 FORMAT HTMTABLE
ON TABLE SET STYLE *
 INCLUDE = endeflt, $
 TYPE=TITLE, JUSTIFY=CENTER,$
ENDSTYLE
END
-RUN
-*
SET HTMLFORMTYPE=DOC
-RUN
-HTMLFORM BEGIN
<style>
    @page
    {
        mso-page-border-surround-header: no;
        mso-page-border-surround-footer: no;
    }

    @page Section1
    {
        size:841.9pt 595.3pt;
        mso-page-orientation:landscape;
        margin: 0.7cm 0.7cm 0.7cm 0.7cm;
        mso-header-margin: 42.55pt;
        mso-footer-margin: 49.6pt;
        mso-paper-source: 0;
        layout-grid: 18.0pt;
    }

    div.Section1
    {
        page: Section1;
    }
</style>

<div class="Section1">
!IBI.FIL.OUTPUT1;
<p style="page-break-before: always">
!IBI.FIL.OUTPUT2;
</div>
-HTMLFORM END 

August 01, 2016, 02:46 PM
Doug
Thanks David, I can use that method in the mean time... Smiler Doug