Contents MDDB Report Viewer Methods Previous Next

_OUTPUT_OPTBTN_URL_FN_ Method

Outputs the optbtnurl JavaScript function in the Dimensions and Options toolbar page

The optbtnurl function is called when the Options button is pressed.

Syntax

 CALL SEND(OBJID,'_OUTPUT_OPTBTN_URL_FN_',url);

Example

The following output is produced:

function optbtnurl() {
   with (window.parent.main.document.mf) {
      var limit = elements.length;
      href = "/cgi-bin/broker?_PROGRAM=SASHELP.WEBEIS.OPTIONS.SCL";
      for (i=0; i<limit; i++) {
         if (elements[i].value != "") {
            if (elements[i].name == "_PROGRAM") 
               continue;
            var thisvar=elements[i].name.toUpperCase();
            if (thisvar == "D" || thisvar == "AC" || thisvar == "A") {
               var sellength = elements[i].options.length;
               var numselected = 0;
               for (j=0; j<sellength; j++) {
                  if (elements[i].options[j].selected) {
                     numselected++;
                     if (numselected == 1) {
                        href += "&" + elements[i].name + "=" + elements[i].options[j].value;
                     }
                     href += "&" + elements[i].name + eval(numselected) + "=" + elements[i].options[j].value;
                     if (thisvar == "A") {
                        var href2="";
                        stats=elements[i].options[j].value+"STATS";
                        statsstr="window.parent.main."+stats;
                        statsarray=eval(statsstr);
                        if (statsarray.length==1 && statsarray[0]=="nunique") {
                           href2+="&A" +j +"S" +"=" +"NUNIQUE";
                        } 
                        else if (statsarray.length==1 && statsarray[0]!="nunique") {
                           href2+="&A" +j +"S" +"=" +"SUM";
                        }
                        else {
                           var anum=0;
                           for (k=1; k&ltstatsarray.length; k++) {
                              anum=j+1;
                              href2+="&A" +anum +"S" +k +"=" +statsarray[k];
                           }
                           var numstats = statsarray.length-1;
                           if (numstats > 1) {
                              href2+="&A" + anum + "S0=" + numstats;
                           }
                        }
                        href += href2;
                     }
                  }
               }
               if (numselected > 0) {
                  href += "&" + elements[i].name + "0=" + eval(numselected);
               }
            }
            else {
               href += "&" + elements[i].name + "=" + elements[i].value;
            }
         }
      }
   }
   return href;
}

Contents MDDB Report Viewer Methods Previous Next