Focal Point
[SOLVED] HTML Page refresh

This topic can be found at:
https://forums.informationbuilders.com/eve/forums/a/tpc/f/7971057331/m/9847044096

June 26, 2018, 03:32 PM
SBanks
[SOLVED] HTML Page refresh
Can anyone assist with the following issue? I have an HTML page with several reports and charts. I am using the script below to set each of the reports and charts to auto refresh.

The script below works well for the TABLE FILES but for the GRAPH FILES it does not work. The graph does not build. We have narrowed the issue down to two lines of code: the ON GRAPH AUTOFIT and the ON GRAPH PCHOLD FORMAT JSCHART. With both of these lines included the refresh script does not work. Taking either of the two lines out, the refresh works. Any way I can remedy this without pulling out one of the two lines of code? I am using App Studio 8202. Thanks.

 
GRAPH FILE CAR
SUM DEALER_COST
RETAIL_COST
SALES
ON GRAPH PCHOLD FORMAT JSCHART
ON GRAPH SET AUTOFIT ON
END


-HTMLFORM BEGIN
  < !DOCTYPE html>
  <body onload="setTimeout['document.f1.submit[);',2000);">
  <form name=f1 action="/ibi_apps/run.bip" method="get" target="_self">
  <input type="hidden" name="BIP_REQUEST_TYPE" value="BIP_RUN">
  <input type="hidden" name="BIP_folder"       value="IBFS:/WFC/Repository/IT_Development_Joe_B/">
  <input type="hidden" name="BIP_item"         value="AUTO_REFRESH.fex">
  <input type="hidden" name="Rand"             value="!IBI.AMP.Rand;">
  !IBI.FIL.REPORT01;
  </body>
  </html>
-HTMLFORM END
-RUN

 

This message has been edited. Last edited by: FP Mod Chuck,


8202
June 26, 2018, 03:38 PM
mlhapner
ON GRAPH PCHOLD FORMAT JSCHART will not allow you to use the graph later on in the HTMLFORM. Instead, you want to hold the graph as the NAME in !IBI.FIL.{NAME}; .

So instead, you should have ON GRAPH HOLD AS REPORT01 FORMAT JSCHART. (really you should rename that to something like GRAPH01 or CHART01)


WebFOCUS 8.201m
Windows, All Outputs
June 27, 2018, 07:24 AM
Chaudhary
you can integrate this html page in BIP portal and use the portal refresh property .


WF Production :- WF:8.0.0.4, 8.1.05 App-studio/Developer Studio(8.1.x) ,
8.2.0.1M , 8.2.0.2 (App-Studio8.2.x),
InfoAssist/+, InfoDiscovery
Output format:-AHTML, PDF, Excel, HTML
Platform:-Windows 7, 8,10
June 27, 2018, 09:22 AM
SBanks
Thanks mlhapner, I changed the line of code to hold the graph using !BI.FIL name. The graph is building now, but it is no longer refreshing.

I am using the HTML page in a portal and currently using the portal refresh option. However since the maximum refresh timing is like 90 seconds, it refreshes too often for users.


GRAPH FILE CAR
SUM DEALER_COST
RETAIL_COST
SALES
-*ON GRAPH PCHOLD FORMAT JSCHART
HEADING
"CAR REFRESH TEST"
"AT &TOD"
ON GRAPH HOLD AS GRAPH01 FORMAT JSCHART
ON GRAPH SET AUTOFIT ON
END

-HTMLFORM BEGIN
  <!DOCTYPE html>
  <body onload="setTimeout('document.f1.submit();',2000);">
  <form name=f1 action="/ibi_apps/run.bip" method="get" target="_self">
  <input type="hidden" name="BIP_REQUEST_TYPE" value="BIP_RUN">
  <input type="hidden" name="BIP_folder"       value="IBFS:/WFC/Repository/IT_Development/SarahB/Reports/Supv_Dashboard/notes/">
  <input type="hidden" name="BIP_item"         value="AUTO_REFRESH.fex">
  <input type="hidden" name="Rand"             value="!IBI.AMP.Rand;">
  !IBI.FIL.GRAPH01;
  </body>
  </html>
-HTMLFORM END
-RUN


  



8202
June 27, 2018, 09:45 AM
mlhapner
Why do you need to have a refresh timer?

Couldn't you just have an onchange or onafterload function on the elements in the HTML page that refreshes the graph & report?


WebFOCUS 8.201m
Windows, All Outputs
June 27, 2018, 10:06 AM
SBanks
I do have the onchange functionality in place. That works well for users viewing at a desk. But we will project the dashboard on a monitor so it will need to refresh itself every 5 or 10 mins.


8202
June 28, 2018, 01:00 PM
Doug
Hey Sarah,

Not sure why so many people as using JavaScript (I'm not a big fan of it and know that statement will cause chaos). But, HTML CODE will do what you want (I used to be a WebMaster, actually code web pages in HTML).

So, consider this:
-* FP HTML Page refresh.fex
-SET &ECHO = ALL ;
GRAPH FILE CAR
-*TABLE FILE CAR
SUM DEALER_COST
RETAIL_COST
SALES
HEADING
"CAR REFRESH TEST AT &TOD"
ON GRAPH HOLD AS GRAPH01 FORMAT HTMTABLE
ON GRAPH SET AUTOFIT ON
-*ON TABLE HOLD AS GRAPH01 FORMAT HTMTABLE
-*-*ON TABLE HOLD AS GRAPH01 FORMAT JSCHART
ON TABLE SET AUTOFIT ON
END
-RUN
-HTMLFORM BEGIN
<HTML>
<head>
  <title>HTML in 10 Simple Steps or Less</title>
  <meta http-equiv="refresh" content="2"> <!-- See the difference? -->
</head>
<body>
<TABLE><TR><TD>
!IBI.FIL.GRAPH01;
</TD></TR></TABLE>
</BODY>
</HTML>
-HTMLFORM END
-*-HTMLFORM BEGIN
-*  <!DOCTYPE html>
-*  <body onload="setTimeout('document.f1.submit();',2000);">
-*  <form name=f1 action="/ibi_apps/run.bip" method="get" target="_self">
-*  <input type="hidden" name="BIP_REQUEST_TYPE" value="BIP_RUN">
-*  <input type="hidden" name="BIP_folder"       value="IBFS:/WFC/Repository/KGPCo_IT/Doug/FP_HTML_Page_refresh.fex">
-*  <input type="hidden" name="BIP_item"         value="FP_HTML_Page_refresh.fex">
-*  <input type="hidden" name="Rand"             value="!IBI.AMP.Rand;">
-*  !IBI.FIL.GRAPH01;
-*  </body>
-*  </html>
-*-HTMLFORM END
-RUN
I left most of your code in there.

Enjoy, Doug