Solved

Write Web Page data from AS400 program

Posted on 2006-10-22
6
280 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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

On Demand Webinar - Networking for the Cloud Era

This webinar discusses:
-Common barriers companies experience when moving to the cloud
-How SD-WAN changes the way we look at networks
-Best practices customers should employ moving forward with cloud migration
-What happens behind the scenes of SteelConnect’s one-click button

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
CWBX .NET Message Queue 9 348
AS/400 - Steps to finding what the problem is? 20 123
c# call as400 program with integer parameters 5 597
Varsity Logistics Speedwigh and AS/400 issues 18 67
Facebook has became the #1 social media platform. People share many funny videos there, yet you don't know how to download them? Now you can download Videos from Facebook in just 3 simple steps.
This article describes a method of delivering Word templates for use in merging Access data to Word documents, that requires no computer knowledge on the part of the recipient -- the templates are saved in table fields, and are extracted and install…
In a recent question (https://www.experts-exchange.com/questions/29004105/Run-AutoHotkey-script-directly-from-Notepad.html) here at Experts Exchange, a member asked how to run an AutoHotkey script (.AHK) directly from Notepad++ (aka NPP). This video…

697 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