title: How to sum the data of a column in Jasper Report
body: <p>I want to make a Jasper Report that desplays a field and at the end it sums all the numbers from it. The problem is that the column is java.lang.String because it has dashes(-) and numbers.</p>
  <p>For example I have the column in the picture. I create a variable that sums every number of the column. For every dash it should add a zero. So for the example column the result should be sum=282.</p>
  <p><a href="https://i.stack.imgur.com/QvTpY.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/QvTpY.png" alt="enter image description here" /></a></p>
  <p>I tried the following.</p>
  <pre><code>IF(Boolean.valueOf($F{Column}).equals(&quot;-&quot;) ? $V{Sum} = $V{Sum } + 0 :  $V{Sum}= $V{Sum} + Long.parseLong($F{Column}))
  </code></pre>
  <p>But it gives an error &quot;The left-hand side of an assignement must be a variable&quot;</p>
  <p>Does anyone have any ideas on how to do it correctly? Thank you!</p>