Solved

Write Web Page data from AS400 program

Posted on 2006-10-22
6
279 Views
Last Modified: 2012-08-14
I have an application that is set to write AS400 data to a web page.  From the browser address line, I connect via IP address to the AS400 and run my AS400 program (written in RPG ILE) directly from the address line.  The program runs and writes the data directly to a web page via CGI script using the "gethtmlifs" command, then displays the web page.  I write sections at a time to the web page using the "WrtSection" command.  The entire process runs almost instantly.  

Here's the problem:  I need to loop this program to refresh the data.  I have the loop set to 10 seconds in the CL that calls the program.  The CL is the program I run from the address line.  When I do, the browser window just appends to the bottom.  The screen gets longer and longer and the user has to scroll down to see the data.  That will not do.  I want the loop in my program to refresh the screen with the new values of my data and the user oes not have to touch anything.  Essentially, it is displaying production on an assembly line.   As units are produced, the counter on the web page will show that by incrementing.   As the program loops, the screen should refresh with curent data.

Does anyone know how to refresh the page or tell it to rebuild the page from the top?  This is needed urgently so points are available.

0
Comment
Question by:tperegoy
  • 2
6 Comments
 
LVL 14

Expert Comment

by:daveslater
ID: 17787300
Hi
have you issued the
 callp     wrtsection('*fini')
to clear the buffer?

Dave
0
 

Author Comment

by:tperegoy
ID: 17787578
Yes, but that is in my last write command to output the screen.  The last section is named $endform so I "WrtSection $endform *fini"  
0
 
LVL 14

Accepted Solution

by:
daveslater earned 250 total points
ID: 17787590
Hi
have a look at this?it might help

http://www-922.ibm.com/cgidev2o/faq15.htm?ts=ts20061023104654

control the refresh from the browser not the cl

Dave
0
 
LVL 33

Assisted Solution

by:shalomc
shalomc earned 250 total points
ID: 17812187
Simply add this to your html inside the <head> section:

<meta http-equiv="refresh" content="10">

Another way is by the xmlhttp javascript method - the AJAX way.

<script>
function GetFromRPG(txtFile) {
       var RPGURL = "http://yourserver/" + escape(txtFile) ;
    var xmlhttp = new ActiveXObject("Microsoft.XMLHTTP");
    xmlhttp.Open('GET', RPGURL , false);
    xmlhttp.Send();
    document.write(xmlhttp.responseText);
    return xmlhttp.responseXML;
}

</script>

ShalomC
0

Featured Post

Free Tool: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Starting your own business is always a daunting process, and for most people it is brand new experience. Avoid the common pitfalls by following these tips to start on the road to success.
When it comes to protecting Oracle Database servers and systems, there are a ton of myths out there. Here are the most common.
Established in 1997, Technology Architects has become one of the most reputable technology solutions companies in the country. TA have been providing businesses with cost effective state-of-the-art solutions and unparalleled service that is designed…
In an interesting question (https://www.experts-exchange.com/questions/29008360/) here at Experts Exchange, a member asked how to split a single image into multiple images. The primary usage for this is to place many photographs on a flatbed scanner…

840 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question