Focal Point
[SOLVED] Portal and a HTML Form is double running reports on load

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

August 14, 2014, 02:48 PM
thop7777
[SOLVED] Portal and a HTML Form is double running reports on load
I have an HTML form set up with a list of parameters to pass to a few reports I have on a portal. I used the instructions and some trial and error and the form works perfectly and all the reports refresh without issue.

The issue I am having is that when I initially load the portal all the reports seem to run twice (the slower the connection the more noticeable this is). They run on the initial load (before the html form is finished loading) and then once the html form is loaded the javascript on it with the onInitialUpdate fires and it runs the reports again as it has the refresh in there. When that refresh fires all the reports run with the correct values from the parameter. But the reports themselves have different defaults than the parameter form so it seems like the report changes while you are looking at it. The first time it runs without the values from the htmlform and the second time it runs with the values. This only happens on the initial load. Once loaded you can change pages and come back and everything is wonderful.

Is there a setting somewhere in portal that say to not run the reports by default? I really don't want to run every report twice on initial load. I haven't been able to find any setting like that, or anyway to do that from edit mode on the portal.

-Tim

This message has been edited. Last edited by: <Kathryn Henning>,


Product: WebFocus 8808,Server: Ubuntu Linux, Output: html/excel/pdf
August 14, 2014, 03:55 PM
David Briars
I wonder if one possibility is that the HTML form is getting refreshed, and with that, the other panels are then rerun.

The REFRESH_ALL_BUT_SELF parameter of the refresh function is supposed to prevent that.

Here is what my 'refreshReports()' function looks like; my report panels only refresh one time upon page load:
function refreshReports(){
var name = this.window.name;
parent.BipIframeInterface.setAllAmpersValues(name, IbComposer_getAllAmpersValues());
parent.BipIframeInterface.refresh(parent.BipIframeInterface.REFRESH_ALL_BUT_SELF, name);
}  





Test: WebFOCUS 8.1.05M Prod: WebFOCUS 8.1.05M Server: Windows Server 2012/Tomcat Standalone Workstation: Windows 7/IE 11 Database: Oracle 12c/Netezza Output: AHTML/XLSX/HTML/PDF/JSCHART Tools: WFDS, Repository Content, BI Portal Designer, & ReportCaster

August 15, 2014, 09:01 AM
thop7777
Thanks David, I don't believe that is it.

You can see that the html form isn't finished loading yet and the other reports are loaded. Then when the html form is finished it sends out the refreshall and all the reports then run with the correct parameters.

It's like if I put just a report on the portal (no html form) the report runs and returns with the defaults of the report. If I add an html form then I "reload" the page (again only happens on full reloads) you can see the report run with the report's parameters...then run again when the html form is loaded. It's like I need a way to stop the report from running initially on a refresh.

I have the following in my refreshall

parent.BipIframeInterface.setAllAmpersValues(name, IbComposer_getAllAmpersValues());
parent.BipIframeInterface.refresh(parent.BipIframeInterface.REFRESH_ALL_BUT_SELF , name, null, parent.BipIframeInterface.AMPERS_PAGE_ONLY);


Product: WebFocus 8808,Server: Ubuntu Linux, Output: html/excel/pdf
August 15, 2014, 09:50 AM
thop7777
Oh and I don't know if I stated this clearly, but if I hit the run button on the html form the reports only run once like they are suppose to. So it's just on the "initial" load that they run twice.


Product: WebFocus 8808,Server: Ubuntu Linux, Output: html/excel/pdf
August 15, 2014, 10:11 AM
David Briars
One troubleshooting technique I have used: Run the HTML Composer page stand-alone (from WFDS) and check for any JavaScript errors.
August 15, 2014, 10:33 AM
David Briars
OK, your refresh function runs fine when triggered by your 'run' button.

Are you also calling your refresh function from onInitialUpdate()?:
function onInitialUpdate(){
 refreshReports();
}  

August 15, 2014, 10:46 AM
thop7777
Yes. And it is working as I believe once the html form is finished it fires then causes the other reports to refresh. Here is the entire javascript.

//Begin function window_onload
function window_onload() {

UpdateData();

// TODO: Add your event handler code here
//add onInitialUpdate() function to make changes before initial run of the reports

}
//End function window_onload

function onInitialUpdate(){


refreshReports();
}


//Begin function form1Submit_onclick
function form1Submit_onclick(ctrl) {
refreshReports();

}
//End function form11Submit_onclick

function refreshReports(){
var name = this.window.name;
parent.BipIframeInterface.setAllAmpersValues(name, IbComposer_getAllAmpersValues());
parent.BipIframeInterface.refresh(parent.BipIframeInterface.REFRESH_ALL_BUT_SELF , name, null, parent.BipIframeInterface.AMPERS_PAGE_ONLY);
}


Product: WebFocus 8808,Server: Ubuntu Linux, Output: html/excel/pdf
August 15, 2014, 03:54 PM
eric.woerle
I would check the request list for your IFrame. I've had it happen to me multiple times that the HTML Composter has added extra requests at the bottom of the HTML and then included all of them in the request list. IE request_list='1;2;3;4' then if the the IFRAME is set to auto execute it would execute and run the query four times to the IFRAME. Don't know if the same thing is happening for you, but worth checking. APP Studio's html composter should show you all of your requests in the GUI and give you a way to maintain it, where in DS you still have to manually make the adjustment in the HTML. As always in that case, developer beware.


Eric Woerle
8.1.05M Gen 913- Reporting Server Unix
8.1.05 Client Unix
Oracle 11.2.0.2
August 15, 2014, 04:59 PM
thop7777
I'm using webfocus portals tool. So the html form is just a form with a date and some other fields but has no reports on the form. I drag that onto my portal and drag a report over and it works (if you have it all set up right). It's not done in application studio but is done from within the webfocus portal on edit mode.

I've had the same problem you've had Eric when doing an html dashboard like that.


I viewed the html on the form to be sure and there is nothing on there for executing anything other than the javascript. no request_list or anything.


Product: WebFocus 8808,Server: Ubuntu Linux, Output: html/excel/pdf
August 18, 2014, 09:10 AM
J
No Request List? So how is your button running the report then? Is there anything happening for the default onload request? I double check and make sure that request is empty.


WebFOCUS 7.7.03/8.0.08
Dev Studio 7.7.03/8.0.08
App Studio 8.0.08
Windows 7
ALL Outputs
August 18, 2014, 09:42 AM
thop7777
J, The portal is refreshed based off of javascript. So on the html form you add javascript (which is listed earlier in this post) So click on run it fires javascript which refreshes all the reports on the portal you are in. There is no request list in the html form itself as there is no report tied to the html form. Javascript handles running what reports on on the dashboard.

I did come up with a solution I don't like much, but works. I made the defaults of all my reports be the same default as the html form and I turned off the refreshreports on the onInitialUpdate. That fixes the issue, but now I have to remember whenever I have to change the default on the parameter form to change the defaults on all the reports also. Long as I keep up with doing that it should work. Which is what I don't like cuz 1 year from now when someone asks for a new default I won't remember how it's all set up.


Product: WebFocus 8808,Server: Ubuntu Linux, Output: html/excel/pdf