title: What is the ideal approach to export reports to Excel and CSV using JasperReports?
body: <p>I am using <em>iReport</em> designer to export reports into <em>PDF</em> format and <em>CSV</em> formats. Now for the <em>PDF</em>
  format, everything seems perfect, but when I use the same design to export to <em>CSV</em>, the whole
  layout goes haywire. I would document all the necessary research i have gathered. Let's have
  a look at the report format in <em>PDF</em> and then <em>CSV</em>.</p>
  
  <p><strong>PDF Format</strong></p>
  
  <p><img src="https://i.stack.imgur.com/iRv7M.jpg" alt="PDF Format for the Report"></p>
  
  <p><strong>CSV Format</strong></p>
  
  <p><img src="https://i.stack.imgur.com/AzOUg.jpg" alt="CSV Format for Report"></p>
  
  <p>Here is the research gathered.</p>
  
  <ol>
  <li><em>PDF</em> format is pixel perfect reports where <em>CSV</em> reports. </li>
  <li>We can use <a href="http://jasperreports.sourceforge.net/sample.reference/jasper/index.html#csvmetadataexport" rel="nofollow noreferrer">CSVMetaDataExporter</a> in order to just extract the data and set the column names describing the types and data using export parameters. Though i have not used the second option still.</li>
  </ol>
  
  <p>So my basic question is, if we want to use the same template to export <em>CSV</em> or <em>Excel</em>, we would be obviously running into alignment and width issues. I exported the report to <em>Excel</em> as well and in the <em>Excel</em> format the results were not at all satisfactory. So in this context, is <em>JasperReports</em> really a correct choice to opt for <em>Excel</em> and <em>CSV</em> formats? If it is, what is the ideal approach to deal with such output formats?</p>