Getting report name from client method

rated by 0 users
This post has 1 Reply | 2 Followers

Top 75 Contributor
Posts 16
Points 210
jenC Posted: Mon, Mar 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)

Top 10 Contributor
Posts 178
Points 1,240
SamsAn replied on Tue, Apr 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 "";
}

  • | Post Points: 5
Page 1 of 1 (2 items) | RSS