Focal Point
[SHARING] Embedding Results of TABLE Command In HTML.

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

March 16, 2009, 04:07 PM
David Briars
[SHARING] Embedding Results of TABLE Command In HTML.
Greetings,

When I embed HTML, generated with the TABLE command, within an HTML page, an outline of my code looks something like this:
  
 TABLE FILE HOLDIT
  output html tags here..
  ON TABLE HOLD AS CLFD FORMAT ALPHA
 END
-RUN
-HTMLFORM BEGIN
 <html>
  more html goes here
    !IBI.FIL.CLFD;
  more html goes here
 </html>
-HTMLFORM END


I have recently been asked to look at someone else's code, that does the same type of thing. That code looks like this:
  
 TABLE FILE HOLD1
  output html tags here..
 ON TABLE HOLD AS HTMTBL1 FORMAT HTMTABLE
 END
-RUN
-HTMLFORM BEGIN
 <html>
 more html tags go here
-HTMLFORM HTMTBL1
-HTMLFORM BEGIN
 more html tags go here
</html>
-HTMLFORM END


My question is: Is it correct coding practise, to include TABLE generated code via '-HTMLFORM filename'?

Background: I've been asked to look at this code, because we believe it might be causing the following error: 'Unknown error occurred. Agent on reporting server x may have crashed. Please investigate reporting server log.'

Regards,
Dave

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




Pilot: WebFOCUS 8.2.06 Test: WebFOCUS 8.1.05M Prod: WebFOCUS 8.1.05M Server: Windows Server 2016/Tomcat Standalone Workstation: Windows 10/IE11+Edge Database: Oracle 12c, Netezza, & MS SQL Server 2019 Output: AHTML/XLSX/HTML/PDF/JSCHART Tools: WFDS, Repository Content, BI Portal Designer & ReportCaster
March 16, 2009, 04:14 PM
Francis Mariani
I always embed the HTMTABLE format files with !IBI.FIL.HTMTBL1;

I don't know if the -HTMLFORM HTMTBL1 is causing the "Unknown error occurred..." but I'd change the code to verify that.


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 16, 2009, 04:41 PM
Diptesh Patel
Dave:
It is not good practice to code it the way you see it. However (at least in IE), it does work. The end result is that you have the code for 2 HTML pages being shown together. Some browsers may not be as forgiving.


Diptesh
WF 7.1.7 - AIX, MVS
March 16, 2009, 05:13 PM
Francis Mariani
The correct syntax for HTMLFORM would be something like this:

-HTMLFORM BEGIN
 <html>
 more html tags go here
-HTMLFORM END
-HTMLFORM HTMFIL1
-HTMLFORM BEGIN
 more html tags go here
</html>
-HTMLFORM END


HTMFIL1 would be a file in the Application folder path.


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 16, 2009, 08:17 PM
susannah
David, i of course agree with what Francesco and Diptesh have said. the error you're getting is a server error, and the code you're addressing is browser code.
so i'ld look deeper into your fex bits to see whats up.
in your first example, you're holding FORMAT ALPHA
and in your second, you're holding HTMTABLE.
Be sure you know that your ALPHA file, with some html bracketing it, actually renders in a webpage.
-s




In Focus since 1979///7706m/5 ;wintel 2008/64;OAM security; Oracle db, ///MRE/BID
March 17, 2009, 03:19 AM
Tony A
quote:
Is it correct coding practise, to include TABLE generated code via '-HTMLFORM filename'?
To add to the discussion, I would answer -"Yes, but not when it is enclosed within -HTMLFORM BEGIN and -HTMLFORM END". That is my belief anyway.

Francis,

What does the documnetation say? I'm surprised that you didn't quote it! .... or is it one of those items that is hidden in the depths?

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 
March 17, 2009, 03:48 AM
GamP
My first concern would be to try and find out which part of the code is causing the crash.
I'ld do that by running the fex bit by bit until it fails. That would give me the part of the fex that is violating some rule by crashing. The challenge then is to find the cause and remedy it.


GamP

- Using AS 8.2.01 on Windows 10 - IE11.
in Focus since 1988
March 17, 2009, 05:49 PM
David Briars
Many thanks to everyone for making this a great discussion.

I'll attempt to respond to everyone:





Pilot: WebFOCUS 8.2.06 Test: WebFOCUS 8.1.05M Prod: WebFOCUS 8.1.05M Server: Windows Server 2016/Tomcat Standalone Workstation: Windows 10/IE11+Edge Database: Oracle 12c, Netezza, & MS SQL Server 2019 Output: AHTML/XLSX/HTML/PDF/JSCHART Tools: WFDS, Repository Content, BI Portal Designer & ReportCaster
March 17, 2009, 06:11 PM
j.gross
There was a time long ago (3.x or 4.x) when you could 'stack' a series of -HTMLFORMs, and the cumulative HTML would get rendered. My experience indicates that in recent releases the first one is honored and the remainder go to the bit-bucket. -- So, if the program harks back to that era, you'll have to rework it.
March 17, 2009, 07:25 PM
susannah
the bit bucket Good One




In Focus since 1979///7706m/5 ;wintel 2008/64;OAM security; Oracle db, ///MRE/BID