As of December 1, 2020, Focal Point is retired and repurposed as a reference repository. We value the wealth of knowledge that's been shared here over the years. You'll continue to have access to this treasure trove of knowledge, for search purposes only.
Join the TIBCO Community TIBCO Community is a collaborative space for users to share knowledge and support one another in making the best use of TIBCO products and services. There are several TIBCO WebFOCUS resources in the community.
From the Home page, select Predict: WebFOCUS to view articles, questions, and trending articles.
Select Products from the top navigation bar, scroll, and then select the TIBCO WebFOCUS product page to view product overview, articles, and discussions.
Request access to the private WebFOCUS User Group (login required) to network with fellow members.
Former myibi community members should have received an email on 8/3/22 to activate their user accounts to join the community. Check your Spam folder for the email. Please get in touch with us at community@tibco.com for further assistance. Reference the community FAQ to learn more about the community.
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
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...
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, 2005
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>
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);