title: How to print field values horizontally in a table in JasperReport
body: <p>I am using <strong>Jaspersoft Studio 6.3.1.final</strong> to design a report with a table among other elements.</p>
  
  <p>The design looks like below. The table only has a <strong>Column Header</strong> and a <strong>Detail</strong> section.</p>
  
  <p><a href="https://i.stack.imgur.com/u8reC.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/u8reC.png" alt="enter image description here"></a></p>
  
  <p>Now the fields are printed vertically like this:</p>
  
  <pre><code>COLUMN_HEADER1  |  COLUMN_HEADER2
  col1Val1        |  ...
  col1Val2        |  ...
  col1Val3        |  ...
  </code></pre>
  
  <p>But what I need is to display them horizontally like this:</p>
  
  <pre><code>COLUMN_HEADER1    |   col1Val1   |     col1Val2     |      col1Val3
  COLUMN_HEADER2    |   ...        |     ...          |      ...
  </code></pre>
  
  <p>I searched the net and couldn't get any luck.</p>
  
  <p>Is there a way to do that? I am stuck in here. Your help will be greatly appreciated!</p>
  
  <p><strong>Edit:</strong> </p>
  
  <p>That's how I pass in the data to the report (using existing Java service to generate a JRBeanCollectionDataSource).</p>
  
  <pre><code>    List&lt;Map&lt;String, Object&gt;&gt; aListOfMap = ...;
      JRDataSource jrDataSource = new JRBeanCollectionDataSource(aListOfMap);
      HashMap&lt;String, Object&gt; parameters = new HashMap&lt;&gt;();
      parameters.put("DataSource", jrDataSource);
      JasperPrint jasperPrint = getObjectPdf("reports/report.jrxml", parameters, new JREmptyDataSource());
  </code></pre>