Solved

Write Web Page data from AS400 program

Posted on 2006-10-22
6
275 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 32

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

What Is Threat Intelligence?

Threat intelligence is often discussed, but rarely understood. Starting with a precise definition, along with clear business goals, is essential.

Join & Write a Comment

Get to know the ins and outs of building a web-based ERP system for your enterprise. Development timeline, technology, and costs outlined.
In this article, I show you step by step with screenshots to assist you - HOW TO: Deploy and Install the VMware vCenter Server Appliance 6.5 (VCSA 6.5), with some helpful tips along the way.
Illustrator's Shape Builder tool will let you combine shapes visually and interactively. This video shows the Mac version, but the tool works the same way in Windows. To follow along with this video, you can draw your own shapes or download the fileā€¦
When you create an app prototype with Adobe XD, you can insert system screens -- sharing or Control Center, for example -- with just a few clicks. This video shows you how. You can take the full course on Experts Exchange at http://bit.ly/XDcourse.

744 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

Need Help in Real-Time?

Connect with top rated Experts

13 Experts available now in Live!

Get 1:1 Help Now