title: BIRT report parameter with multiple values passed from JSP page
body: <p>I have integrated BIRT in web application.I am using Eclipse Luna,JDK 1.8, BIRT Report Engine 4.1.1 and <strong>Data source I am using is Excel Data Source(not JDBC and all that)</strong>. From my JSP page I am passing two parameters in the URL using  Javascript AJAX like:`       </p>
  
  <pre><code>var reporturl ="/Reporting/loadReport?ReportName="+reportName+"&amp;ReportFormat=html&amp;Supplier=Supplier4&amp;Metal=Gold&amp;Metal=Tin";     
  
      $("#reportData").html("Loading...&lt;br&gt;&lt;img src='/Reporting/resources/images/loading.gif' align='middle' &gt;");
  
      $('#reportData').load(reporturl ,function(response, status, xhr) {
  
        if (status == "error") {
          var msg = "Sorry but there was an error getting details ! ";
          $("#reportData").html(msg + xhr.status + " " + xhr.statusText);
        }
      });
  </code></pre>
  
  <p>For report parameter "Metal" I have selected Display type : List Box, Data Type : String and have selected Dynamic Values and then have checked "Allow Multiple Values" checkbox. Then in the Property Editor of table, in Filters tab I have given the expressions as follows:</p>
  
  <pre><code>row["Supplier Name"] Equal to params["Supplier"].value
  row["Metal"] In params["Metal"].value
  </code></pre>
  
  <p>After this switching to JavaEE perspective in my ReportRenderer.java , I have the following code to get multiple values associated with the "Metal" parameter(which are passed from the URL), I have merged those values as a comma(,) seperated list in a single String variable like :</p>
  
  <pre><code>    public static String getParameter( HttpServletRequest request,
          String parameterName )
  {
  
      if ( request.getCharacterEncoding( ) == null )
      {
          try
          {
              request.setCharacterEncoding( UTF_8_ENCODE );
          }
          catch ( UnsupportedEncodingException e )
          {
          }
      }
      String[] values = request.getParameterValues(parameterName);
      String temp="";
      if(values.length&gt;1)
      {
          int i=0;
         for(i=0;i&lt;values.length-1;i++)
         {
           temp=temp+values[i]+",";
         }
         temp=temp+values[i];
      }
      else
      {
          temp = values[0];
      }
  
      return temp;
  }
  </code></pre>
  
  <p>In a HashMap I am getting all parameters and it's respective values successfully and have set that Map like:</p>
  
  <pre><code>HashMap&lt;String,Object&gt; tempMap = new HashMap&lt;String,Object&gt;(); 
      tempMap = discoverAndSetParameters( runnable, request ); 
      for(String str : tempMap.keySet())
      {
          System.out.println("Key : "+str);
          System.out.println("Value : "+tempMap.get(str));
      }
      iRunTask.setParameterValues(tempMap);
  </code></pre>
  
  <p>Here runnable is the object of IReportRunnable and request is the object of HttpServletRequest.
  Now when I am running the web application, after clicking on the hyperlink named "Reports" I am getting following exception on console and no output on web page.</p>
  
  <pre><code>org.eclipse.birt.report.engine.api.impl.ParameterValidationException: The type of parameter "Metal" is expected as "Object[]", not "java.lang.String".
  at org.eclipse.birt.report.engine.api.impl.EngineTask.validateAbstractScalarParameter(EngineTask.java:857)
  at org.eclipse.birt.report.engine.api.impl.EngineTask.access$0(EngineTask.java:789)
  at org.eclipse.birt.report.engine.api.impl.EngineTask$ParameterValidationVisitor.visitScalarParameter(EngineTask.java:706)
  at org.eclipse.birt.report.engine.api.impl.EngineTask$ParameterVisitor.visit(EngineTask.java:1531)
  at org.eclipse.birt.report.engine.api.impl.EngineTask.doValidateParameters(EngineTask.java:692)
  at org.eclipse.birt.report.engine.api.impl.RunTask.doRun(RunTask.java:214)
  at org.eclipse.birt.report.engine.api.impl.RunTask.run(RunTask.java:86)
  </code></pre>
  
  <p>Please help me how to resolve this problem and again I am specifying I am using Excel Data Source not JDBC or Scripted and all that. I have already gone through many blogs where questions are related to JDBC data source and that didn't helped me.</p>