title: Jasper reports compile error for SUM function with spring mvc
body: <p>I am using jasper reports to generate reports from my spring mvc application.</p>
  
  <p>It works fine as long as I do not use any math functions in jasper report.
  For example the SUM function in jasper reports gives me a compile time error on my application -</p>
  
  <pre><code>1. The method SUM(int) is undefined for the type ContentUsageStatisticsReport_1426086372880_332015
                  value = SUM(((java.math.BigDecimal)field_cnt.getValue()).intValue()); //$JR_EXPR_ID=15$
  </code></pre>
  
  <p>Here is the field from jasper reports.</p>
  
  <pre><code>&lt;textField&gt;
              &lt;reportElement x="210" y="1" width="130" height="20" uuid="45fbed39-f63a-41ff-8ff1-88821aeefcd1"/&gt;
              &lt;textFieldExpression&gt;&lt;![CDATA[SUM($F{cnt}.intValue())]]&gt;&lt;/textFieldExpression&gt;
  &lt;/textField&gt;
  </code></pre>
  
  <p>Does this mean that I cannot use Jasper functions in the report and the calculations must be done on server? If so, then how do I calculate subtotals for each page of the report?.</p>