Show the parameters in an array

minsc87
edited February 11, 2022 in Analytics #1
<p>Hi, I'm sorry for my English, I wanted to know if it was possible to show the name and the values of multiple value parameter and retrieve it as if it were an array. For example, if I had two parameters Company and diagram showing the name and value of each.</p>
<div> </div>
<div>var par = params.lenght;</div>
<div>for (i = 0; i <par; i ++) {</div>
<div> </div>
<div>"Parameter:" + param + .label "Value:" + param .toString().replace(/,/g,",");</div>
<div> </div>
<div>}</div>

Comments

  • <p>It is simpler than an iterator....  Simply do this in a Dynamic Text :</p>
    <p> </p>
    <p>              "names are: " + params["Names"].value.join();</p>
    <p> </p>
    <p>Gives the list of names from the "Names" parameter where one or more names are displayed. </p>
  • <div>
    <div>Thank you for the reply.</div>
    <div>I'm sorry, but I have not explained well, I wish that the parameters are generated dynamically, where in params["Name"].value.join()  "Name" should be replaced automatically by the name of the parameter from an Array.</div>
    </div>
    <div>It's possible?</div>
    <div> </div>
    <div>for example:<br>
     </div>
    <div>
    <div style="margin:0px;color:rgb(40,40,40);font-family:'Source Sans Pro', sans-serif;">var par = params.lenght; //I don't know if it is correct</div>
    <div style="margin:0px;color:rgb(40,40,40);font-family:'Source Sans Pro', sans-serif;"> </div>
    <div style="margin:0px;color:rgb(40,40,40);font-family:'Source Sans Pro', sans-serif;">for (i = 0; i <par; i ++) {</div>
    <div style="margin:0px;color:rgb(40,40,40);font-family:'Source Sans Pro', sans-serif;"> params.value.join() //where i is the name of parameter</div>
    </div>
    <p>}</p>
  • <div>I found a solution, but it shows only the last parameter:<br><br><div>var parameters = reportContext.getDesignHandle().getAllParameters();</div>
    <div> </div>
    <div>for (var i=0; i<parameters.size(); i++) {</div>
    <div> </div>
    <div>  <span> </span>parameters.getName()+": "+params[parameters.getName()].value.join();</div>
    <div> </div>
    <div>}<br><br>
    I have two parameters but it show only the last!</div>
    </div>
  • minsc87
    edited April 3, 2017 #5
    <p><span style="color:rgb(40,40,40);font-family:'Source Sans Pro', sans-serif;">I found a solution:</span><br><br>
    var parameters = reportContext.getDesignHandle().getAllParameters();</p>
    <div>var riepilogo="";</div>
    <div> </div>
    <div>for (var i=0; i<parameters.size(); i++) {</div>
    <div>if (i==0){</div>
    <div>riepilogo+="PRAMETRI"+"\n"+"\n"+parameters.getName()+": "+params[parameters.getName()].value.join();</div>
    <div>}</div>
    <div>else {</div>
    <div>riepilogo+="\n"+"\n"+parameters.getName()+": "+params[parameters.getName()].value.join();</div>
    <div>}</div>
    <div>}</div>
    <div> </div>
    <div>riepilogo;<br><br>
    Thanks  :D</div>