This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

DEVELOPERS FORUM - Getting report name from client method

jenC - Monday, March 30, 2009 5:34 PM:

Hi,

I have several different reports that I want to run the same javascript method because they basically all do the same thing.  There is one difference though depending on which report they run.  I cannot find a way in my javascript client method to figure out which report was run in order to handle them slightly differently.

Any help figuring out which report I ran would be greatly appreciated.  I've tried adding content to the Report Query without luck. 

We're running 8.1.1 currently (planning on upgrading to 9.1 as soon as possible)



SamsAn - Tuesday, April 21, 2009 2:59 AM:

Hi.

Unfortunately, there are no standard API to retrieve a running report name. But I used the code below to get the report name in its javascript method  (it works in 9.1):

var reportName;

try
{
  var c = arguments.callee.caller;
  var cntr = 0
  while (c && c.toString().indexOf("function Aras_runClientReport")!=0 && cntr<10)
  {
    c = c.caller;
  }
  if (c && c.toString().indexOf("function Aras_runClientReport")==0)
  {
    reportName = top.aras.getItemProperty(c.arguments[0], "name");
  }
}
catch (ex)
{
  reportName = undefined;
}
if (!reportName)
{
  top.aras.AlertError("Internal Exception: Cannot define selected report name.");
  return "";
}