Topic
2 replies Latest Post - ‏2012-04-20T06:54:34Z by Nasreen.Banu
SystemAdmin
SystemAdmin
217 Posts
ACCEPTED ANSWER

Pinned topic cognos drill down error through Javascript

‏2011-09-06T20:29:42Z |
when I load a report in Portal and then click on a bar within the chart to dril down, I get an error ...not sure what is causing it ..Any idea's ?? I am using cognos 10.1
Error 404: EJCBD0021E: The URI spa:Z6_8000CB1A00FIE0I9SOQML40082/html/loadReportUrl(%22http://*...*:9081/ServletGateway/servlet/Gateway/rds/pagedReportData/searchPath/content/package%255b@name=] and parameters [] could not be processed: [EJPEI0088E: The resource
Before I click on the link and check the return results the function : loadReportUrl shows in firebug

href='loadReportUrl("http://9.161.81.93:9081/ServletGateway/servlet/Gateway/rds/pagedReportData/searchPath/content/package%255b@name='intelligent_Water'%255d/report%255b@name='water_usage_single_account'%255d?async=AUTO&fmt=JSON&selection=Combination%20Chart1&p_dateTextBox_start=2010-09-06&p_dateTextBox_end=2011-09-06&p_customerIDTextBox=3070859&p_summarizeSelect=%255byearly%255d&p_filterSegment=%255bsum%255d/drill?direction=DOWN&contextId=2","" )' alt='' title=''/><area shape='poly' coords='268,318,292,318,292,331,268,331'

Code snippet
myFunction :((responseObject, ioArgs, cmsURL))

if (ioArgs.xhr.status == 202){
var newurl= ioArgs.xhr.getResponseHeader("Location");
var startPos = newurl.indexOf('/rds');
cmsURL = gateway + newurl.substring(startPos);
cmsURL = encodeURI(cmsURL);
objXHR.onreadystatechange = myFunction;
}
else{
cmsURL = gateway+ioArgs.url.substring(ioArgs.url.indexOf('/rds'));
cmsURL = encodeURI(cmsURL);
}

var reportPart = eval('(' + responseObject + ')');
var chart = reportPart.filterResultSet.filterResult[0].reportElement[0].cht;

// The Chart will contain a URL to the chart image, but to make it dynamic we'll also
// construct an Image map to handle drilling down.
var imageHTML = "";
imageHTML += "<map name='chartmap'>";

// The chart region section defines areas that corresponding to areas on the chart image
var areas = chart.regions.area;
for (var i=0; i < areas.length; i++)
{
// Use the "poly" area type, as the shape of the area may be non-rectangular.
imageHTML += "<area shape='poly' coords='";
var coords = areas[i].coord;
for (var j=0; j < coords.length; j++)
{
if ( j != 0)
imageHTML += ",";
imageHTML += areas[i].coord[j].x;
imageHTML += ",";
imageHTML += areas[i].coord[j].y;
}

// Build ctx drill down. Depending on the version of Cognos, it
// may be directly under the area in the form "#:#", or their might
// be a member/measure section
var drillCtx;
if (areas[i].ctx)
{
drillCtx = areas[i].ctx;
}
else
{
if (areas[i].measure && areas[i].member)
drillCtx = areas[i].measure[0].ctx + ":" + areas[i].member[0].ctx;
}

//taken the code out for drill down
// Finally, need to handle the drill down by defining the link to use our loadReportURL
// method
console.log("cmsURL =",cmsURL);
imageHTML += "' href='loadReportUrl(\"" + cmsURL + "/drill?direction=DOWN&contextId=" +
drillCtx + "\",\"" + areas[i].label + "\" )'";
imageHTML += " alt='"
imageHTML += areas[i].label;
imageHTML += "' title='";
imageHTML += areas[i].label;
imageHTML += "'/>";
Updated on 2012-04-20T06:54:34Z at 2012-04-20T06:54:34Z by Nasreen.Banu
  • SystemAdmin
    SystemAdmin
    217 Posts
    ACCEPTED ANSWER

    Re: cognos drill down error through Javascript

    ‏2011-09-06T20:32:49Z  in response to SystemAdmin
    full error

    Error 404: EJCBD0021E: The URI spa:Z6_8000CB1A00FIE0I9SOQML40082/html/loadReportUrl(%22http://*...*:9081/ServletGateway/servlet/Gateway/rds/pagedReportData/searchPath/content/package%255b@name=] and parameters [] could not be processed: [EJPEI0088E: The resource
    • Nasreen.Banu
      Nasreen.Banu
      1 Post
      ACCEPTED ANSWER

      Re: cognos drill down error through Javascript

      ‏2012-04-20T06:54:34Z  in response to SystemAdmin
      Hi Alex,
      Can you share the JS to drill-through (if possible multiple drill-though).. as i have one such scenario which i can achive using only JS.

      Thanks,
      Nasreen