title: jasper report - how to output value of Java variable?
body: <p>I'm trying to test jasperreport and wrote Java code but it giving me error:</p>
  
  <pre><code>    -------------------- PDF exception 
      net.sf.jasperreports.engine.JRException: 
  Error loading byte data : C:\Users\mt\Desktop\project20111116\test
  \src3\report2_1336431810533_776931.class
  </code></pre>
  
  <p>What am I doing wrong?</p>
  
  <p><strong>Code:</strong></p>
  
  <pre><code>public static void main(String[] args) {
  
      try {
  
          File jrxmlFile = new File("C:\\Users\\mt\\report2.jrxml");
  
          if(jrxmlFile.exists()) {
  
              //jrxml complie
              JasperReport jasperReport =    JasperCompileManager.compileReport(jrxmlFile.getAbsolutePath());
  
              List&lt;Map&lt;String, ?&gt;&gt; list = new ArrayList&lt;Map&lt;String, ?&gt;&gt;();
  
              for (int i = 0; i &lt; 10; i++) {
                  Map&lt;String, String&gt; map = new HashMap&lt;String, String&gt;();
                  map.put("orderNumber", "hello");
                  map.put("anotherNumber", "world");
                  //map.put("canIUseArray", new String[]{"foo", "bar", "moo", "pee"});
                  list.add(map);
             }
  
  
            JRMapCollectionDataSource dataSource = new JRMapCollectionDataSource(list);
  
            JasperPrint jasperPrint = JasperFillManager.fillReport(jasperReport, new HashMap(), dataSource);
  
            JasperViewer.viewReport(jasperPrint, false);
  
        }
     }
     catch(Exception e) {
        System.out.println("-------------------- PDF exception ");
        System.out.println(e); 
     }
  
  System.out.println("DONE");
  
  }//end main
  </code></pre>