Focal Point
[SOLVED] SAving HTMLFORM

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

August 05, 2009, 10:12 AM
philippe@Nantes
[SOLVED] SAving HTMLFORM
Hello everybody
I just want to save my my HTMLFORM in a fiule for later usage.
I wrote this :
-HTMLFORM app/mymodel.htm SAVE AS app/myreport.htm
When I lauch the fex containing -HTMLFORM nothing is treated !!
Is anybody can help me ?

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


WebFocus thru Dev Studio version 7.6.11
Dev Studio on Windows Xp, Webfocus Client on UNIX basing on TOMCAT and DB2,
Reporting Server on MVS , USS and on UNIX
August 05, 2009, 10:18 AM
susannah
philippe,
your fex is making an output file called mymodel.htm, is that right?
ON TABLE HOLD AS MYMODEL FORMAT HTML
..or something like that, is that right?

so if youwant to park that html file someplace,
you filedef it
FILEDEF MYMODEL DISK /yourroot/.../somedirname/MYMODEL.HTM
then run your fex
and the html file created will park itself wherever you have designated, rather than in the agent.
If you want to both park it and display it, you can omit the filedef, and use the unix copy command !cp to copy it from the agent directory to your parking place.
If that's what youwant to do, post back, and we'll show you how to grab the full server location of your agent directory for using in your !cp command.




In Focus since 1979///7706m/5 ;wintel 2008/64;OAM security; Oracle db, ///MRE/BID
August 05, 2009, 10:22 AM
<JG>
quote:
-HTMLFORM app/mymodel.htm SAVE AS app/myreport.htm


That will very definately not work, you obviously have not read much documentation.

To save a file permanantly you must issue a filedef OR set APP HOLD

The code line starting -HTMLFORM may only contain BEGIN if a -HTMLFORM END is used
or the name of the file to either -INCLUDE or !IBI.FIL.file;
August 05, 2009, 10:27 AM
philippe@Nantes
Susannah
my fex generates multiple hold file withe HTMTABLE format to insert-them in my mymodel.htm via !IBIL.FIL.FICONE; !IBIL.FIL.FICTWO; ans so on.
IT is the result of the -HTMLFORM command that i want to save.


WebFocus thru Dev Studio version 7.6.11
Dev Studio on Windows Xp, Webfocus Client on UNIX basing on TOMCAT and DB2,
Reporting Server on MVS , USS and on UNIX
August 05, 2009, 10:33 AM
philippe@Nantes
JG
I read this in Dev Studio ONline Help:
Command:
-HTMLFORM
Function:
Sends report output to the HTML file you create for a Web page and displays that page in the browser. The output can also be saved as an HTML file that can be displayed later.

Syntax:
-HTMLFORM filename [SAVE AS htmlpage]or

-HTMLFORM BEGIN...-HTMLFORM ENDwhere:

filename

Is the HTML file that contains placeholders for the report or reports WebFOCUS creates with the command:


SAVE

Indicates that the HTML page, created when the HTML file filename and the report or reports generated by WebFOCUS are combined, is to be saved.


AS htmlpage

Is the file name for the HTML page that is created when the HTML file filename and the report or reports generated by WebFOCUS are combined. This file is saved so that it can be displayed later.


-HTMLFORM BEGIN

Indicates the beginning of an inline HTML form in a procedure.


-HTMLFORM END

Indicates the end of an inline HTML form in a procedure.

Is documentation obsolete ? perhaps


WebFocus thru Dev Studio version 7.6.11
Dev Studio on Windows Xp, Webfocus Client on UNIX basing on TOMCAT and DB2,
Reporting Server on MVS , USS and on UNIX
August 05, 2009, 11:27 AM
Tony A
Philippe,

The only method I could get to work is as JG suggests and that is to FILEDEF the target first -
FILEDEF CARHTML1 DISK C:\ibi\apps\focalpoint\carhtml.htm
-RUN
DEFINE FILE CAR
END
TABLE FILE CAR
  SUM RCOST
      DCOST
   BY COUNTRY
   BY CAR
   BY MODEL
ON TABLE HOLD AS CARHTML FORMAT HTML
END
-RUN
-HTMLFORM CARHTML SAVE AS CARHTML1

The output from this indicates that the HOLD is first saved (to EDATEMP) and then saved to the FILEDEF'd location. You will not get the HTML page displayed. You would have to repeat the -HTMLFORM CARHTML to achieve that.

Bearing in mind that you are in MRE environment you will have to consider what your build of servers is - e.g. web server and reporting server on one machine, network share allowing reporting server to write files to web server for use via URL etc.

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 05, 2009, 11:48 AM
philippe@Nantes
Tony
I tried this :
TABLE FILE P6FDLF3
PRINT
J AS 'Lundi'
J1 AS 'Mardi'
J2 AS 'Mercredi'
J3 AS 'Jeudi'
J4 AS 'Vendredi'
J5 AS 'Samedi'
J6 AS 'Dimanche'
TOTAL_S AS 'Total ,semaine'
OBJECTIF_S AS 'Objectif ,de la semaine'
COMPUTE RAPPORTS/D12.2 = ( TOTAL_S / OBJECTIF_S ) * 100; AS 'R/O'
TOTAL_M AS 'Total ,mois   '
OBJECTIF_M AS 'Objectif ,du mois      '
COMPUTE RAPPORTM/D12.2 = ( TOTAL_M / OBJECTIF_M ) * 100; AS 'R/O'
PCT.TT/P10.2% AS 'Poids, M'
TOTALMOIS_1 AS 'Total ,M-1'
PCT.TTM/P10.2% AS 'Poids, M-1'
-*
BY LIB_FAM_CAN AS ''
BY LIB_COD AS 'Catégorie'
BY LIB_MRQ AS 'Marque'
ON LIB_FAM_CAN SUBTOTAL AS 'TOTAL'
-*
ON TABLE SET PAGE-NUM OFF
ON TABLE RECOMPUTE AS 'TOTAL'
HEADING
" "
"Analyse CMI - TOTAL semaine en cours"
ON TABLE SET PAGE-NUM OFF
-*ON TABLE PCHOLD AS PRESENTATION20 FORMAT EXL2K TEMPLATE 'presentation19' SHEETNUMBER 19
ON TABLE HOLD AS dwnrs19p FORMAT HTMTABLE
END

FILEDEF DWNRS00P DISK '/usr/local/tws/DWN1/tmp/DWNRS00P.htm'
-RUN
-HTMLFORM app/qwbfp74c.htm SAVE AS DWNRS00P

The dwnrs19p has to be imbeded in app/qwbfp74c.htm

But when i run this I've got :
Error occurred.
ERROR: ERROR_MR_FEX_NOT_FOUND Impossible de créer l'objet d'élément selon la clé d'élément fournie app/qwbfp74c.htm SAVE AS DWNRS00P.

(Sorry it's in FRENCH)


WebFocus thru Dev Studio version 7.6.11
Dev Studio on Windows Xp, Webfocus Client on UNIX basing on TOMCAT and DB2,
Reporting Server on MVS , USS and on UNIX
August 05, 2009, 12:31 PM
susannah
phillipe
you need to have FILEDEF'd before your fex has created the output file.
so your FILEDEF belongs before the TABLE FILE.
...
i've never seen the SAVE AS syntax
nor do i think it would work
but the FILEDEF syntax i use 1000 times a day,
parking them in my user directories in the basedir
...
now, the other part of your request...
you seem to be creating your final HTML presentation as a complex thing, with some ! modules..
That i can't help you with. I would FILEDEF each of the component modules,
then recall them with a fex that
FILEDEF's each source .htm
and then calls them with the !
FILEDEF FILE1 DISK /.../file1.htm
FILEDEF FILE2 DISK /.../file2.htm
( no quote marks around the filenames, )
-RUN
-HTMLFORM BEGIN
<HTML>
<HEAD>
..
</HEAD>
!IBI.FIL.FILE1;
!IBI.FIL.FILE2;
</HTML>
-HTMLFORM END

Its fun to see error messages in french.




In Focus since 1979///7706m/5 ;wintel 2008/64;OAM security; Oracle db, ///MRE/BID
August 05, 2009, 02:07 PM
Tony A
quote:
so your FILEDEF belongs before the TABLE FILE.
S,

No so. If you change my example to reflect Philippe's style then -
TABLE FILE CAR
  SUM RCOST
      DCOST
   BY COUNTRY
   BY CAR
   BY MODEL
ON TABLE HOLD AS CARHTML FORMAT HTML
END
FILEDEF CARHTML1 DISK C:\ibi\apps\focalpoint\carhtml1.htm
-RUN
-HTMLFORM CARHTML SAVE AS CARHTML1
functions as before and I get the carhtml1.htm file in the focalpoint apps folder. Providing you ensure the filedef is executed before the -HTMLFORM (basically DM), it should be OK.

Philippe,

I think that your fundemental problem is that WF can't locate the "app/qwbfp74c.htm" file. As I mentioned before, you're using MRE so there are other things to take into account.

As for including your output in the INCLUDEd file, not really tried it and not sure that it would resolve correctly. I would need to play a bit.

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 05, 2009, 02:26 PM
Tony A
Back again. OK, a file within a static file using something like Philippe's code -
FILEDEF CARHTML1 DISK C:\ibi\apps\focalpoint\carhtml1.htm
-RUN
DEFINE FILE CAR
END
TABLE FILE CAR
  SUM RCOST
      DCOST
   BY COUNTRY
   BY CAR
   BY MODEL
ON TABLE HOLD AS CARHTML FORMAT HTML
END
-RUN
-HTMLFORM CARHTML SAVE AS CARHTML1
-HTMLFORM include_it

My "include_it.htm" file contains this, and exists in the focalpoint app folder - the same location as the original fex above -
<HTML>
<HEAD>
<TITLE>WebFOCUS Report</TITLE>
<BASE HREF="http://localhost:8080/approot/focalpoint/">
</HEAD>
<BODY>
!IBI.FIL.carhtml1;
</BODY>
</HTML>

Not sure if this will help Philippe but it might fire some ideas?

Bon chance

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 05, 2009, 02:30 PM
Tony A
Interestingly enough, if I try and save the "include_it.htm" with the !IBI.FIL reference resolved then I have a completed file -

FILEDEF CARHTML1 DISK C:\ibi\apps\focalpoint\carhtml1.htm
FILEDEF MYTEST DISK C:\ibi\apps\focalpoint\mytest.htm
-RUN
DEFINE FILE CAR
END
TABLE FILE CAR
  SUM RCOST
      DCOST
   BY COUNTRY
   BY CAR
   BY MODEL
ON TABLE HOLD AS CARHTML FORMAT HTML
END
-RUN
-HTMLFORM CARHTML SAVE AS CARHTML1
-HTMLFORM include_it SAVE AS mytest
-HTMLFORM mytest

Mytest.htm is full of the wrapper (no Danny NOT wrapapp! Wink) with the report contents.

Seems an overly complex method of building your html files though?

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 06, 2009, 03:25 AM
<JG>
Philippe, my apologies. You are quite correct about the syntax, a hidden gem I overlooked.

And Tony that’s exactly what is supposed to happen
quote:
SAVE
Indicates that the HTML page, created when the HTML file filename and the report or reports generated by WebFOCUS are combined, is to be saved.

August 06, 2009, 03:29 AM
philippe@Nantes
Tony,
I'm agree with you about complex method of building the html file, but the enduser wants it on one piece.
I'm agree too that MRE environment is not so funny.
Tony and Susannah thank you very much for your help.

Au revoir


WebFocus thru Dev Studio version 7.6.11
Dev Studio on Windows Xp, Webfocus Client on UNIX basing on TOMCAT and DB2,
Reporting Server on MVS , USS and on UNIX