title: Initialize a HashMap Variable in iReport
body: <p>I want to create a variable $V{myMap} in iReport (3.7.3) and initialize a Map with this:</p>
  
  <pre><code>"key1":"value1","key2":"value2","key3:"value3" ...
  </code></pre>
  
  <p>Then in my report I will have a textField with this expression:</p>
  
  <pre><code>$V{myMap}.get("key1")
  </code></pre>
  
  <p>and i must to get </p>
  
  <pre><code>"value1"
  </code></pre>
  
  <p>What steps i must to follow to get that?</p>
  
  <hr>
  
  <p>I read here:</p>
  
  <p><a href="https://stackoverflow.com/questions/3439524/i-want-to-use-java-util-hashmap-as-variable-in-jasperreport">How to use a java Hashmap as variable in JasperReport</a></p>
  
  <p>these steps to set the variable properties:</p>
  
  <p>set the following properties on the variable:</p>
  
  <pre><code>Name: myMap
  Variable class: java.util.HashMap()
  Reset type: None
  Calculation: System
  Variable expression: new java.util.HashMap()
  </code></pre>
  
  <p>But what about initialize it?</p>
  
  <p>I know i can use groovy and use maps like in this article:</p>
  
  <p><a href="http://groovy.codehaus.org/Collections" rel="nofollow noreferrer">http://groovy.codehaus.org/Collections</a></p>
  
  <p>But i dont' know which steps to follow.</p>
  
  <p>Thanks in advance for share your knowledge!</p>