title: How do you call a Java method with two parameters from JasperReports
body: <p>I have a JasperReports' jrxml file that contains calls of Java method code with one int parameter. All works well with the following code using a single parameter. <strong>eventProjectid is an Integer</strong></p>
  
  <pre><code>&lt;textField&gt;
      &lt;reportElement positionType="Float" x="250" y="79" width="103" height="15"/&gt;
      &lt;textFieldExpression&gt;&lt;![CDATA[com.rem40.reports.ReportUtils.getCubeXAxisLabelMaxConsequenceProject($F{eventProjectId})]]&gt;&lt;/textFieldExpression&gt;
  &lt;/textField&gt;
  </code></pre>
  
  <p>I need to introduce a second parameter which does not work, all I get is a null value back. Here is the jrxml code 
  <strong>eventProjectId is an Integer</strong> and <strong>eventType is a String</strong>.</p>
  
  <pre><code>&lt;textField&gt;
      &lt;reportElement positionType="Float" x="250" y="79" width="103" height="15"/&gt;
      &lt;textFieldExpression&gt;&lt;![CDATA[com.rem40.reports.ReportUtils.getCubeXAxisLabelMaxConsequenceProject($F{eventProjectId},$F{eventType})]]&gt;&lt;/textFieldExpression&gt;
  &lt;/textField&gt;
  </code></pre>
  
  <p>Here is the Java code that I am trying to call</p>
  
  <pre><code>public static String getCubeXAxisLabelMaxConsequenceProject(Integer projectId, String eventType){
      ProjectEntity projectEntity = projectService.findById(projectId);
  
      CubeConfigEntity cubeConfigEntity=cubeConfigService.findByCubeTypeName(eventType,projectEntity.getCubeConfigName());
      if (cubeConfigEntity != null) {
          return cubeConfigEntity.getxAxisName();
      } else {
          return "";
      }
  }
  </code></pre>
  
  <p>Just to be clear I have tried to debug the call to no available. I believe there is an issue with how the method signature try to compare from the jrxml to the Java method. In debug the single parameter methods get called but the method with two parameters never gets called.</p>
  
  <p>Any help would be appreciated.</p>