If you are unable to create a new account, please email support@bspsoftware.com

 

News:

MetaManager - Administrative Tools for IBM Cognos
Pricing starting at $2,100
Download Now    Learn More

Main Menu

Parameter with a list of values in a report call

Started by jedi2005, 05 Jan 2006 01:58:53 AM

Previous topic - Next topic

jedi2005

Hi,

i try to call a report out of the source report directly by calling the full path and name with a parameter containing a list of values.
These values are selected by the user from a list box.
If there is only one entry in the list, the call works perfectly. But with more than one value the target report does not get the information out of the list.
(I tried a lot with different brackets, escape-function in java script etc.; drill-through is not possible)

May someone solve my problem or is this impossible?

Many thanks for replys

MrO

Are you sure the filter in the destionation report is 'in (?myparam?)' and not '= ?myparam?' ?

jedi2005

yes, definitely, because I call the same report only in a new window and in pdf-format

bdybldr

Not too sure about how you're trying to accomplish this but when you define your links between a source report and it's child in RS, the only operator available is "=" (parent.[field1]=child.[?param1?).  I'm pretty sure that is the problem here too.  It can't accept multiple values for the same parameter.

Hope this helps.  Keep us posted.

jedi2005

Sorry, but I think that's not the problem.
I call the report in Javascript with a link like reportpfad+reportname+"&p_list_param="+param_list_value+"&tb=0&nh=1".
The last two parameters are the reason why I can't use a drill-through.

bdybldr

Jedi,
The following was posted under a different topic by Avaldez.  Maybe this ill help you...

The below code was sent to me as a workaround for allowing multiple values to be passed in a drill-through.  I have not been able to get this to work.  It needs to be added as a custom toolbox object in Report Studio.  If anybody is familiar with the custom toolbox technique and would like to give this a shot, feel free and please post your results. 

<script>
   //
=========================
=================
   // multi-select parameter pass on drillthrough (version 2004-11-28)
   // Tested through v 1.1 MR2
   // requires addition to prompting.js at line 79
   // To use: Build drillthroughs as normal,
   // drag script to anywhere within report.
   //
=========================
=================

   // needs to be changed if crn is not on same server
   var crnPath = "http://"+document.domain+sGateway;
   // output locale. change this if needed
   var locale = "en-us";
   //
=========================
=================
   // no need to change anything below here
   //
=========================
=================
   //
=========================
=================

   var cookies = document.cookie.split(";");

   cookies = cookies[0].split("prompts=");
   // remove encoding
   cookies = cookies[1].split("*").join("%").split("|").join("/");
   cookies = unescape(cookies).split(",");

   var allprompts = new Array();
   for (var i=0;i<cookies.length;i++) {
      allprompts.push(new Array(cookies,cookies[i+1]));
      i++;
   }
   //alert(allprompts.toString());
   function prepareFilters() {
      var param = unescape("%26");
      var out = "";
      var stemp = "";
      var str = "";
      for (var i=0; i<allprompts.length; i++) {
         var tmp = allprompts[1].split("useValue=");
         if (tmp.length<3) {
            stemp = tmp[1].split(" selected=");
            str = stemp[0].substr(1,String(stemp[0]).length-2);
            str = ((str.split(" ")).join("+"));
            out += param + allprompts
  • + "=" + escape(str);
             } else {
                for (var j=1; j<tmp.length; j++) {
                   stemp = tmp[j].split(" selected=");
                   str = stemp[0].substr(1,String(stemp[0]).length-2);
                   str = ((str.split(" ")).join("+"));
                   out += param + allprompts
    • + "=" + escape(str);
                  }
               }
            }
            //var c = new Date();
            //document.cookie = "prompts=;expires="+c.toGMTString()+";"+";";
            return out;
         }
         function buildURL(cell,num) {
            var param = unescape("%26");
            if (!num) {
               var id = cell.nextSibling.innerHTML;
               var co = cell.innerHTML;
            } else {
               var id = num;
               var co = cell;
            }
            if (hlinkArray[Number(id)] == 0) {
               return;
            }
            if (!num) {
               var obj =
      unescape(hlinkArray[Number(id)].split("obj\",\"")[1].split("\"), new
      Array")[0]);
               var tname =
      escape(obj.split("report[@name='")[1].split("']")[0]);
               var param = unescape("%26");
               var link = hlinkArray[Number(id)].split("\""+co.split("
      ").join("+")+"\"")[0].split("p_");
            } else {
               // 1.1 MR1
               var obj =
      unescape(hlinkArray[Number(id)].split("obj','")[1].split("'),createArray"
      )[0]);
               var tname =
      escape(obj.split("report[@name='")[1].split("']")[0]);
               var param = unescape("%26");
               var link = hlinkArray[Number(id)].split("'"+co.split("
      ").join("+")+"'")[0].split("p_");
            }
            //
      =========================
      ==
            // added for cw
            var rawparams = hlinkArray[Number(id)].split("p_");
            var otherParams = "";
            for (var i=1; i<rawparams.length; i++) {
               var t =
      param+"p_"+rawparams.split("'")[0]+"="+rawparams.split("'")[2];
               otherParams += t;
            }
            //
      =========================
      ==
            if (link.toString().charAt(link.toString().length-1) == "}") {
               pdiag = confirm("There is no drill parameter for this selection.
      Are you sure you want to continue?");
               if (pdiag == false) {
                  return;
               }
            } else {
               if (!num) {
                  link =
      param+"p_"+link[link.length-1].split("\",")[0]+"="+co.split("
      ").join("+");
               } else {
                  // 1.1 MR1
                  link =
      param+"p_"+link[link.length-1].split("',")[0]+"="+co.split("
      ").join("+");
               }
            }
            var par = prepareFilters();
            par += link + otherParams;
            //alert(par);
            // remove duplicate params (added 11-28-2004)
            var allpars = "";
            var p = par.split(param);
            for (var i=1; i<p.length; i++) {
               var n = p.split("=")[1];
               if (allpars.split(n).length < 2) {
                  allpars += param + p;
               }
            }
            par = allpars;
            //alert(par);
            var url = crnPath +
      "?b_action=xts.run"+param+"m=portal/report-viewer.xts"+param+"method=
      execute"+param+"m_obj="+escape(obj)+param+"outputFormat=HTML"+param+"
      outputLocale="+locale+param+"prompt=false"+param+"m_name="+tname+pa
      ram+"runoptions=true"+par+param+"backURL="+escape(sBackURL);
            document.location = url;
         }
         function calcLinks() {
            var spans = document.body.getElementsByTagName("span");
            for (var i=0; i<spans.length; i++) {
               if (spans.className == "hyperlink") {
                  if (spans.parentNode.onclick != null) {
                     hlinkArray.push(spans.parentNode.onclick.toString());
                     spans.parentNode.onclick = function () { return false; };
                     var nnum = document.createElement("tag");
                     nnum.style.display = "none";
                     nnum.innerHTML = i;
                     spans.parentNode.appendChild(nnum);
                     spans.onclick = function () { buildURL(this); return false; };
                     // 1.1 MR1 uses HREF ***
                  } else if (spans.parentNode.parentNode.href != null &&
      spans.parentNode.parentNode.onclick == null) {
                     hlinkArray.push(spans.parentNode.parentNode.href);
                     var nnum = document.createElement("tag");
                     nnum.style.display = "none";
                     nnum.innerHTML = i;
                     spans.parentNode.appendChild(nnum);
                     spans.parentNode.parentNode.href =
      "javascript:buildURL('"+spans.innerHTML+"','"+i+"');";
                     // 1.1 MR2 uses onclick but href is not null: href="#"
                  } else if (spans.parentNode.parentNode.onclick != null) {
                     hlinkArray.push(spans.parentNode.parentNode.onclick.toString());
                     spans.parentNode.parentNode.onclick = "";
                     var nnum = document.createElement("tag");
                     nnum.style.display = "none";
                     nnum.innerHTML = i;
                     spans.parentNode.appendChild(nnum);
                     spans.parentNode.parentNode.href =
      "javascript:buildURL('"+spans.innerHTML+"','"+i+"');";
                  } else {
                     hlinkArray.push(0);
                  }
               } else {
                  hlinkArray.push("");
               }
            }
         }
         var hlinkArray = new Array();
         calcLinks();   
      </script>

jedi2005

I really don't if this could help me  ;)
But, of course, many thanks for the script.