Focal Point
[SOLVED] Defeating Report Caching using JAVASCRIPT

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

December 12, 2012, 08:10 PM
Cubesmith
[SOLVED] Defeating Report Caching using JAVASCRIPT
Using the various post found on this forum I've almost managed to defeat a caching issue.

Ok, a bit of back story.

I have a html with a form containing a bunch of filters and a submit button linked to an iframe report which shows a list of items. I also have another iframe report which shows a "shopping cart".

The user clicks on an item (standard drillthrough function) to pass through the item id to a fex in the shopping cart iframe which uses pass through sql to add the item to a table and then executes a table read from the same table.

The problem is that the drill through passes the same url to the iframe which causes a cached report to show.

I've developed a javascript function to calculate a random number and include that in the url but I can't seem to get it to reference the other iframe.

I'm so close to a win here I though someone might know what I'm missing.

Below is the function:

<script type="text/javascript">
function update_report2(param1,param2) {
var param3= 'A';
var param4= Math.random();
var url = '"'+'/ibi_apps/WFServlet?IBIF_webapp=/ibi_apps&|IBIC_server=EDASERVE&|IBIWF_msgviewer=OFF&|IBIAPP_app=mybasefolder baseapp&|&|IBIMR_drill=X,myfolder/myfolder.htm&|IBIF_ex=myfex&|PARAM1='+param1+'&|PARAM2='+param2+'&|PARAM3='+ param3+'&|PARAM4='+ param4.toString()+'"';
var iframe = document.getElementById('report2');
iframe.src = url;
}

This message has been edited. Last edited by: Kerry,


WebFOCUS 7.61
Win7 / Server2003 / Server2008
December 13, 2012, 12:24 AM
Cubesmith
If anyone is interested, I've solved this.

The trick is to add the script to the second iframe and then add a target parameter to the JAVASCRIPT drill out. I found this purely by accident while testing.

Below is the final function:

<script type="text/javascript">
function update_report(param1,param2) {
var param3 = 'A';
var param4 = Math.random();
var url = '/ibi_apps/WFServlet?IBIF_webapp=/ibi_apps&|IBIC_server=EDASERVE&|IBIWF_msgviewer=OFF&|IBIAPP_app=mybasefolder baseapp&|&|IBIMR_drill=X,myfolder/myfolder.htm&|IBIF_ex=myfex&|PARAM1='+param1.toString()+'&|PARAM2='+param2.toString()+'&|PARAM3='+ param3+'&|PARAM4='+ param4.toString();
document.location.href=url;
}



WebFOCUS 7.61
Win7 / Server2003 / Server2008