cancel
Showing results for 
Search instead for 
Did you mean: 

problem: Opening an .irpt page from the link with parameters

0 Kudos

Hi all,

I have a function in my irpt page that recieves params from the link in the browser and populates the form fields then extract data from DB. now my problem is that, it loads correctly one time then it does not the othe try. It can no load correctly first time then the user had to refresh to get it right. Tried browser setting but could not get it to load correctly everytime.

Please assist I am new in MII still getting myself comfortable.

Accepted Solutions (0)

Answers (1)

Answers (1)

Former Member
0 Kudos

Hi Bheki,

Can you please paste the function code and the URL syntax by which you are passing parameters and trying to open the page.

Thanks & Regards,

Anuj

0 Kudos

Hi Anuj,

Here's the link:

http://localhost:XXXXX/XMII/CM/AngloMA/Security/EstimateReport/Main.irpt?Period=01-Mar-2013%20to%203...

Javascript function:

  function DirectAccess()
  {
   var theURL = unescape(location.href);
   Stream= ParameterValue(theURL,"Stream");
   var theDate = ParameterValue(theURL,"Period");
   if(Stream != "unknown")
   {
    StreamTagBrowser.getBrowserObject().setSelectedItem(Stream);
    setTimeout('updateStreamDescription();',200);
  
    var SDate = theDate.substr(0,11);
    var StrDate = new Date.parse(SDate);

    Start_Month.setMonth(StrDate.toString('MM'));
    Start_Month.setYear(StrDate.toString('yyyy'));

    thePeriod = theDate;


    document.PeriodBrowser.getQueryObject().setParam(1,Stream);
    document.PeriodBrowser.getQueryObject().setParam(2,theDate);
    document.PeriodBrowser.getQueryObject().setStartDate(SDate);
    document.PeriodBrowser.updateBrowser(true);

    setTimeout('UpdateResults(thePeriod);',300);
   }
  }

The page opens but from time to time it does not open proparly you need to refresh sometimes if it did open correctly first time.

Former Member
0 Kudos

Hi Bheki,

By looking into your code and the problem you are facing, its likely that you are calling DirectAccess function in such a way that it is called when the applet itself is not created which means you are trying to access an applet by

document.PeriodBrowser.getQueryObject().setParam(1,Stream);
document.PeriodBrowser.getQueryObject().setParam(2,theDate);
document.PeriodBrowser.getQueryObject().setStartDate(SDate);
document.PeriodBrowser.updateBrowser(true);

which is not at all created at that particular point of time and that is why the problem is not consistent as the time taken for the applet creation varies everytime.

To elaborate, if I write a function onload of my irpt page and try to set some parameters of an applet in that function, it will give me error as the load of the page is very fast as compared to the applet creation and for this I should call that function on 'CreationEvent' of applet which makes sure that the function is called only after creation of my applet.

If this is the case for your function call, then you will have to add a logic to check for the applet creation.

Hope this adds some pointer to resolve your problem.

Thanks & Regards,

Anuj