Focal Point Banner


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.


Focal Point    Focal Point Forums  Hop To Forum Categories  WebFOCUS/FOCUS Forum on Focal Point     Dynamic HTML reports and stuffis

Read-Only Read-Only Topic
Go
Search
Notify
Tools
Dynamic HTML reports and stuffis
 Login/Join
 
Silver Member
posted
I am trying to use WebFocus to generate HTML for our new system's gui, however, I am having some difficulties. I was wondering if you could help.

To begin with, here is a brief sample of my code (inserted some spaces to show tags...):

DEFINE FILE TABLEA
DATAROW1/A50 = '< TD >' | DBCOLUMN1 '< /TD >';
DATAROW2/A50 = '< TD >' | DBCOLUMN2 '< /TD >';
END

TABLE FILE TABLEA
DATAROW1
DATAROW2
ON TABLE HOLD AS REPORT FORMAT ALPHA
END

-HTMLFORM BEGIN
< HTML >
< HEAD >
< /HEAD >
< BODY >
!IBI.FIL.REPORT;
< /TABLE >
< /BODY >
< /HEAD >
-HTMLFORM END

The problem occurs with the HTML that is given as output. Because the format is ALPHA, the HTML code that is produced has a ton of trailing spaces throughout (obviously, the concatenation of '< TD >', DBCOLUMN1, and '< /TD >' isn't 50 characters). Even though Internet Explorer only recognizes one of the spaces, it still causes problems with our resulting functionality. I have to use Javascript to constantly trim values, either upon load or when they click on a desired column. This really isn't good architecture at all. The data should be preformatted in the HTML.

I have used the HTML and HTMTABLE outputs (granted, I had to change the define file's functionality to make it work properly), however, those aren't sufficient (maybe there are some options that need to be set, however, I do not know of any). The HTML format produces a complete HTML document, which isn't what I want. The HTMTABLE option produces a table, which is what I want in the end, however, there isn't a good way of updating the tds (columns) and adding functionality. However, the one positive side is that the values are trimmed correctly.

I originally combined all of the tds into one big temporary field. In other words, my define file and table file definition looked like this:

DEFINE FILE TABLEA
DATAROW/A4096 = '< TD >' | DBCOLUMN1 '< /TD >' | '< TD >' | DBCOLUMN2 '< /TD >';
END

TABLE FILE TABLEA
DATAROW
ON TABLE HOLD AS REPORT FORMAT ALPHA
END

There didn't seem to be a problem until we realized that with the number of columns (sometimes 30+) and functionality (onclick, onmouseover, onmouseout, and more) that we wanted to add, 4096 (4K) characters was not near enough. We would run out of room and WebFocus would throw errors.

With all of this being said, I have two questions for you. 1) Is there any way to overcome the 4096 character limit (which is just too small for HTML creation) in a temporary (define/compute) field? 2) Is there any way to remove the trailing spaces and print the result using the !IBI.FIL.REPORT methodology?

Thanks for the help...

Wayne
 
Posts: 35 | Registered: April 20, 2006Report This Post
Platinum Member
posted Hide Post
Wayne:

2) To remove trailing spaces, try using strong concatenation (|| operator suppresses trailing spaces vs | weak concatenation that preserves trailing spaces)

Example 2:

DEFINE FILE CAR
  TR1/A5 = '<tr>' ;
  TR2/A5 = '</tr>' ;
  DATAFIELD1/A50 = '<td>' || COUNTRY || '</td>';
  DATAFIELD2/A50 = '<td>' || CAR || '</td>';
  DATAROW/A110 = TR1 || DATAFIELD1 || DATAFIELD2 || TR2 ;
END

TABLE FILE CAR
  PRINT
    DATAROW
  ON TABLE HOLD AS REPORT FORMAT ALPHA
END

-HTMLFORM BEGIN
<html>
  <head>
  </head>
  <body>
    <table>
      !IBI.FIL.REPORT;
    </table>
  </body>
</html>
-HTMLFORM END


1) And to avoid certains problems with large line lengths, consider change ALPHA to WP FORMAT combined with OVER phrase in order to generate more but shorter lines...

Example 1:

DEFINE FILE CAR
  TR1/A5 = '<tr>' ;
  TR2/A5 = '</tr>' ;
  DATAFIELD1/A50 = '<td>' || COUNTRY || '</td>';
  DATAFIELD2/A50 = '<td>' || CAR || '</td>';
  DATAROW/A110 = TR1 || DATAFIELD1 || DATAFIELD2 || TR2 ;
END

TABLE FILE CAR
  PRINT
    TR1        AS '' OVER
    DATAFIELD1 AS '' OVER
    DATAFIELD2 AS '' OVER
    TR2        AS ''
  ON TABLE SET PAGE NOLEAD
  ON TABLE HOLD AS REPORT FORMAT WP
END

-HTMLFORM BEGIN
<html>
  <head>
  </head>
  <body>
    <table>
      !IBI.FIL.REPORT;
    </table>
  </body>
</html>
-HTMLFORM END

Hope this helps.
Regards,
Mikel


WebFOCUS 8.1.05, 8.2.01
 
Posts: 173 | Location: Madrid, Spain | Registered: May 09, 2003Report This Post
<JG>
posted
Wayne strong concatenation will not remove trailing spaces from the row
it will move them all to the end of the row.

The easiest option is to output as format TAB

Providing you only print a single field this will generate a variable length file
instead of a fixed length as with format ALPHA and because its only got one field
it will not insert a TAB.


 

DEFINE FILE CAR
DATAROW/A100 = '<TR><TD>' || COUNTRY || '</TD>' || '<TD>' || CAR || '</TD></TR>';
END

TABLE FILE CAR
PRINT DATAROW
ON TABLE HOLD AS REPORT FORMAT TAB
END

-HTMLFORM BEGIN
<html>
  <head>
  </head>
  <body>
    <table>
      !IBI.FIL.REPORT;
    </table>
  </body>
</html>
-HTMLFORM END

 
Report This Post
Member
posted Hide Post
Ok, the TAB file and single field idea makes sense, however, it seems as though there could be a problem with the single field reaching more than 4k in length. Is there any way of getting around this?


WebFocus 7.6 client: WinXP server: Windows 2003 Server Edition
 
Posts: 15 | Registered: July 03, 2006Report This Post
Silver Member
posted Hide Post
Thanks JG... We are still having problems with this, but the more we understand the better.

I appreciate all the input and assistance. I thought that was a given, but apparently the bot that monitors for replies feels I need to express my gratitude in writing for everything that I ask... I don't want to get kicked off the forum, but if something works we run with it and move to the next problem... if something doesn't work, we ask questions until we either just give up and try something else, or we solve the problem...

So, Thanks for taking time to help and your idea has helped us narrow the problem. We are now stuck with some 4k limit problem... we have that submitted to NY and will hopefully find out something soon.

Wayne
 
Posts: 35 | Registered: April 20, 2006Report This Post
  Powered by Social Strata  

Read-Only Read-Only Topic

Focal Point    Focal Point Forums  Hop To Forum Categories  WebFOCUS/FOCUS Forum on Focal Point     Dynamic HTML reports and stuffis

Copyright © 1996-2020 Information Builders