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     [RESOLVED] Accessing Individual Values in !IBI.FIL

Read-Only Read-Only Topic
Go
Search
Notify
Tools
[RESOLVED] Accessing Individual Values in !IBI.FIL
 Login/Join
 
Member
posted
I am an absolute newbie to WebFocus. I have seen the product for over a decade now but have never had to actually produce anything for a client until now. The client has essentially asked me to create a free form report in html. I have been searching for days on the best direction to take. I have already built a POC for them in html that mimicked the design from their creative department. What I am trying to do now is somehow populate the html with results from a fex. As a test, I created a fex that will create a HOLD table. What I want to do now is access each individual value of the HOLD table so that I can put it were it belongs on the html form.

I suppose my first question would be whether what I want to do is even possible. Can I access each value of the HOLD table so that I can format it and place it where I want it in the html?

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


Release 8.007
Windows, HTML
 
Posts: 6 | Registered: December 31, 2015Report This Post
Master
posted Hide Post
hi, welcome to WF.

You really need some basic training.
This is not something you want to achieve with !IBI.AMP stuff.

Use either the WF-solution ( i.e. make the HTML in WF GUI an let it populate the form ) or use scripting. ( HTTPRequest object, JQuery, whatever ).

...do training.


_____________________
WF: 8.0.0.9 > going 8.2.0.5
 
Posts: 668 | Location: Veghel, The Netherlands | Registered: February 16, 2010Report This Post
Member
posted Hide Post
Thanks for your insight, Dave. Unfortunately there is no time for training. I did do some basic training a few months back and found that stuff to be very easy to accomplish, but what I need to do now is much more complicated. It is essentially a free-form report in html. I investigated and did some POC work to see if it was a viable solution but I don't think it will be because I cannot control the height of the rows and, as I understand it, cannot do drill downs.

My problem with using the WF GUI to do the HTML is that it already has an expectation on the formatting of the results so I guess I am really going to have to step outside the box and use scripting as you suggested.

Again, thanks for just telling me like it is...

DJ


Release 8.007
Windows, HTML
 
Posts: 6 | Registered: December 31, 2015Report This Post
Master
posted Hide Post
I just posted a possible solution for someone who wanted to dynamically retrieve data into a double listbox:

On click of a button it has to load the data in double list control dynamically

You should be able to use that same technique to insert data anywhere into your HTML document. It uses plain old JavaScript but JQuery would be easier.


App Studio
WebFOCUS 8.1.05M
Windows, All Outputs
 
Posts: 594 | Location: Michigan | Registered: September 04, 2015Report This Post
Member
posted Hide Post
Looking at it now, Squatch. Hopefully it will save me a lot of trouble. I will keep you posted!


Release 8.007
Windows, HTML
 
Posts: 6 | Registered: December 31, 2015Report This Post
Master
posted Hide Post
And using JavaScript or JQuery, you should be able to dynamically create or remove elements depending on how much data you pull in.


App Studio
WebFOCUS 8.1.05M
Windows, All Outputs
 
Posts: 594 | Location: Michigan | Registered: September 04, 2015Report This Post
Member
posted Hide Post
Squatch, I have been working through your code and cannot seem to get the XMLHttpRequest to operate properly. Ultimately the status never gets set to 200. I did some alert messaging and the first time through, once the readyState gets to 4, I receive an error. I assume it is because the status is null. Once I do get a value for the status, it is set to 404. Any idea as to what might be causing this?


Release 8.007
Windows, HTML
 
Posts: 6 | Registered: December 31, 2015Report This Post
Master
posted Hide Post
A 404 would indicate that there is something wrong with your URL. If you haven't done so already, test your URL in a browser to make sure something is being returned.

Or, you can put in an alert that displays your URL so you can be sure it is correct.


App Studio
WebFOCUS 8.1.05M
Windows, All Outputs
 
Posts: 594 | Location: Michigan | Registered: September 04, 2015Report This Post
Member
posted Hide Post
Success!

To accomplish what I needed to do, I did a mix javascript and jQuery to populate a span with a specific id. I will try to reproduce this using some sample data and present it here for posterity and the good of the community!


Release 8.007
Windows, HTML
 
Posts: 6 | Registered: December 31, 2015Report This Post
Master
posted Hide Post
Excellent!


App Studio
WebFOCUS 8.1.05M
Windows, All Outputs
 
Posts: 594 | Location: Michigan | Registered: September 04, 2015Report This Post
Member
posted Hide Post
Here is some trimmed down version of my solution. I am using both javascript and jQuery to show two fields on the page that are placed where ever I want them to go.

The data comes from a fex and stored as XML. For this example, I only need the first record.

-* Focexec: car.fex
TABLE FILE car
PRINT CAR
      MODEL
WHERE RECORDLIMIT EQ 1
ON TABLE PCHOLD FORMAT XML
END
-RUN


<html>
<head>
<title>Free Form Reporting Example</title>
 <script src="http://ajax.googleapis.com/ajax/libs/jquery/1.11.3/jquery.min.js">
 </script>
 <script>
  $(document).ready(function(){
 
// Prepare for Ajax calls
var xmlHttp = false;
 
if (!xmlHttp && typeof XMLHttpRequest != 'undefined') {
 xmlHttp = new XMLHttpRequest();
}
 
// Set the FEX procedure to call, then call it
// The FEX is stored in the crm folder
var url = "/ibi_apps/WFServlet" + "?" + "IBIF_ex=crm/car.fex";
xmlHttp.open("GET", url, true);
xmlHttp.onreadystatechange = domupdate;
xmlHttp.send(null);
 
// Update the spans with the new information
function domupdate() {
 if (xmlHttp.readyState == 4) {
  if (xmlHttp.status == 200) {
   var responseXML = xmlHttp.responseXML;
   var i;
   var j;
 
   var trs = responseXML.getElementsByTagName("tr");
   var indv = [];
   for (i = 0; i < trs.length; i++) {
    var tds = trs[i].getElementsByTagName("td");
    for (j = 0; j < tds.length; j++) {
     indv.push(tds[j].firstChild.nodeValue);
    }
   }
   $("#car").text(indv[0]);   // the values were stored in an array
   $("#model").text(indv[1]); // in the order they were delivered in the fex
  }
 }
}
 
  });
 </script>
</head>
<body bgColor=#ffffff>
<h1>Free Form HTML Example</h1>
<p>This example will automatically populate the two fields below called Car and Model when the page loads.</p> 
<SPAN style="Z-INDEX: 42; BORDER-BOTTOM: black thin solid; POSITION: absolute; LINE-HEIGHT: 10pt; BACKGROUND-COLOR: silver; PADDING-LEFT: 10px; WIDTH: 99px;
 FONT-FAMILY: Arial; HEIGHT: 21px; FONT-SIZE: 8pt; BORDER-RIGHT: black thin solid; PADDING-TOP: 5px; TOP: 160px; LEFT: 30px" id=Text1>Car</SPAN>
<SPAN style="Z-INDEX: 43; BORDER-BOTTOM: black thin solid; POSITION: absolute; BACKGROUND-COLOR: white; PADDING-LEFT: 5px; WIDTH: 163px; FONT-FAMILY: Arial;
 HEIGHT: 21px; FONT-SIZE: 8pt; PADDING-TOP: 5px; TOP: 160px; LEFT: 140px" id=car></SPAN>
<SPAN style="Z-INDEX: 42; BORDER-BOTTOM: black thin solid; POSITION: absolute; LINE-HEIGHT: 10pt; BACKGROUND-COLOR: silver; PADDING-LEFT: 10px; WIDTH: 99px;
 FONT-FAMILY: Arial; HEIGHT: 21px; FONT-SIZE: 8pt; BORDER-RIGHT: black thin solid; PADDING-TOP: 5px; TOP: 187px; LEFT: 30px" id=Text2>Model</SPAN>
<SPAN style="Z-INDEX: 43; BORDER-BOTTOM: black thin solid; POSITION: absolute; BACKGROUND-COLOR: white; PADDING-LEFT: 5px; WIDTH: 163px; FONT-FAMILY: Arial;
 HEIGHT: 21px; FONT-SIZE: 8pt; PADDING-TOP: 5px; TOP: 187px; LEFT: 140px" id=model></SPAN>
</body>
</html>


I hope you find this helpful for future projects. Good luck!

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


Release 8.007
Windows, HTML
 
Posts: 6 | Registered: December 31, 2015Report 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     [RESOLVED] Accessing Individual Values in !IBI.FIL

Copyright © 1996-2020 Information Builders