Focal Point Banner
Community Center Education Summit Technical Support User Groups
Let's Get Social!

Facebook Twitter LinkedIn YouTube
Go
New
Search
Notify
Tools
Reply
  
THEAD Tag [solved]
 Login/Join
 
Guru
posted
Is there a way to get WebFOCUS to put out THEAD tags on HTMTABLE format?

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


Release: WebFOCUS 7.6.8
OS: Windows
Output formats: HTML, PDF, Excel, csv
 
Posts: 256 | Registered: July 21, 2008Reply With QuoteReport This Post
Expert
posted Hide Post
Wouldn't it be lovely? The answer is, unfortunately, WF does not create THEAD and TBODY tags. But you can fool it:

DEFINE FILE CAR
THEADS/A8 = '<THEAD>';
THEADE/A8 = '</THEAD>';
END
TABLE FILE CAR
PRINT
*
HEADING
"<THEADS"
"WEBFOCUS REPORT"
"<THEADE"
WHERE READLIMIT EQ 100
WHERE RECORDLIMIT EQ 100
ON TABLE SET PAGE NOLEAD
ON TABLE SET STYLESHEET *
FONT='ARIAL', SIZE=8, GRID=OFF, $
ENDSTYLE

ON TABLE HOLD AS H001 FORMAT HTMTABLE
END
-RUN

-HTMLFORM BEGIN
<STYLE>
THEAD { COLOR: RED; }
</STYLE>
!IBI.FIL.H001;
-HTMLFORM END


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
 
Posts: 10577 | Location: Toronto, Ontario, Canada | Registered: April 27, 2005Reply With QuoteReport This Post
Guru
posted Hide Post
Neat idea. I guess my needs are too different to make this work for me - I actually want my TH's which are generated for the Titles to be inside of the THEAD...


Release: WebFOCUS 7.6.8
OS: Windows
Output formats: HTML, PDF, Excel, csv
 
Posts: 256 | Registered: July 21, 2008Reply With QuoteReport This Post
Virtuoso
posted Hide Post
Not quite so neat -- the THEAD and /THEAD tags will be inproperly nested: WF encloses each element of the HEADING a TD /TD pair. Standard browsers may not mind, but if the THEAD is needed for an accessibility agent, it may complain.

To include the column titles in the span of the THEAD, you could play with sticking the /THEAD in a conditional subhead, conditioned to appear only at top of page. That way, the column-title lines are sandwiched between the THEAD in the HEADING, and the /THEAD in the SUBHEAD. -- But you'll still have the improper nesting issue.


- Jack Gross
WF through 8.1.05
 
Posts: 1925 | Location: NYC | In FOCUS since 1983 | Registered: January 11, 2005Reply With QuoteReport This Post
Expert
posted Hide Post
Sorry Jack.


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
 
Posts: 10577 | Location: Toronto, Ontario, Canada | Registered: April 27, 2005Reply With QuoteReport This Post
Silver Member
posted Hide Post
Here is a sample on how to add THEAD's, TH's and what ever else you want to add to your table using javascript......

TABLE FILE CAR                                  
PRINT COUNTRY CAR MODEL
WHERE SEAT EQ 2
ON TABLE HOLD AS MYTHING FORMAT HTMTABLE
END 
-RUN                                                
-HTMLFORM BEGIN                                     
<HTML>                                              
<HEAD>                                              
<SCRIPT  LANGUAGE=JAVASCRIPT>                       
function header()
{                     
var doIt = document.getElementsByTagName("TR");
var fixedHTML = "<TABLE BORDER CELLPADDING=1>";
	for (var i = 0; i < doIt.length; i++)
	{
		if (i)
		{
			if (new String(doIt[i].innerHTML).indexOf("<TD vAlign=bottom>") >= 0)
			{
			var theHTML = new String(doIt[2].innerHTML);
			var newHTML = theHTML.replace(/<TD vAlign=bottom>/g, "<TH>");
			newHTML = newHTML.replace(/<\/TD>/g, "</TH>");
			fixedHTML += "<THEAD><TR>"+newHTML+"</TR></THEAD>";
			}
			else if (new String(doIt[i].innerHTML).indexOf("PAGE 1") >= 0) fixedHTML += "";
			else fixedHTML += "<TR>"+doIt[i].innerHTML+"</TR>";
		}
	}
	fixedHTML += "</TABLE>";
document.getElementById("sample").innerHTML = fixedHTML;
}                                                   
</SCRIPT>                                           
</HEAD>                                             
<BODY onload="header()" id="sample">                                              
 !IBI.FIL.MYTHING;                                 
</BODY>                                             
</HTML>                                             


7.6.6 Mainframe
7.6.4 Web Focus
Windows

 
Posts: 45 | Location: Gaffney SC | Registered: March 30, 2007Reply With QuoteReport This Post
Guru
posted Hide Post
I ended up doing it the Javascript as well with the following snippet of code:
 
 var tHead = table.createTHead();
 var oTR = tHead.insertRow();
 var titles = table.getElementsByTagName('th');

 for(var x = 0; x < titles.length; x++)
 {
    var oTH = titles[x];
    oTR.appendChild(oTH);
 }
 table.deleteRow(1);

 


Release: WebFOCUS 7.6.8
OS: Windows
Output formats: HTML, PDF, Excel, csv
 
Posts: 256 | Registered: July 21, 2008Reply With QuoteReport This Post
  Powered by Social Strata  
 


Copyright © 1996-2018 Information Builders, leaders in enterprise business intelligence.