title: Send nested object to Jaspersoft iReport
body: <p>I try to use Jaspersoft iReport to create Report from my POJO and export it to PDF.</p>
  
  <p>My POJO looks like this:</p>
  
  <pre><code>class Topic {
      String topicName
      int topicPoints;
      DateRange dateRange;
      List&lt;Post&gt; posts;
  }
  
  class DateRange {
      LocalDate begin;
      LocalDate end;
  }
  
  class Post {
      String postName;
      int postPoints;
  }
  </code></pre>
  
  <p>I found solution with JRBeanCollectionDataSource, so I created list with one element (my POJO).</p>
  
  <pre><code>ArrayList&lt;Topic&gt; list = new ArrayList&lt;&gt;();
  list.add(topic);
  JRBeanCollectionDataSource beanColDataSource = new JRBeanCollectionDataSource(list);
  JasperPrint jasperPrint = JasperFillManager.fillReport(jasperReport, parameters, beanColDataSource);
  JasperExportManager.exportReportToPdfFile(jasperPrint, "C:/jasper/test.pdf");
  </code></pre>
  
  <p>I have no problems with exporing simple data like Strings, Integers etc.</p>
  
  <p>e.g. this exports fine.  </p>
  
  <pre><code>class Topic {
      String topicName
      Integer topicPoints;
  }
  </code></pre>
  
  <p>With just:
  Drag &amp; Drop fields topicName (with <code>"java.lang.String"</code>) and <code>topicPoints</code> (with <code>"java.lang.Integer"</code>)</p>
  
  <p>But how can I put on my reports nested fields inside dateRange or inside posts?</p>
  
  <p>I see there is field class like <code>java.lang.Object</code> or <code>java.util.List</code>, but how can I define fields inside this Object or List?</p>
  
  <p>My ideal solution would've create report like:</p>
  
  <p><a href="https://i.stack.imgur.com/VWTDG.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/VWTDG.png" alt="My example"></a></p>
  
  <p>UPDATE:</p>
  
  <pre><code>class Topic {
      String topicName
      int topicPoints;
      DateRange dateRange;
      List&lt;Post&gt; posts;
  }
  
  class DateRange {
      LocalDate begin;
      LocalDate end;
  }
  
  class Post {
      String postName;
      int postPoints;
      List&lt;User&gt; users;
  }
  
  class User {
      String userName;
      int userPoints;
  }
  </code></pre>
  
  <p>And what in case when it will be even more nested?</p>