title: JasperReports html and pdf output
body: <p>I'd like to create a dynamic reporting webpage using JSP. Basically it should contain the following parts:</p>
  
  <ol>
  <li>Filter: The user can specify the filter conditions and press a filter button.</li>
  <li>HTML-output: The result of the filter can be seen here. It's one large html page (or several if one page would be too large). It may contain links to other parts of the system.</li>
  <li>PDF-output: The user should be able to save a pdf version of the report for printing or archiving purposes.</li>
  </ol>
  
  <p>Instead of implementing everything myself, I'd like to use a java reporting library, so I created my report using <a href="http://jasperforge.org/projects/jasperreports" rel="noreferrer">JasperReports</a>. The pdf output is really nice, but the html export of the report is not suitable for my purposes.</p>
  
  <p>JasperReport's html export creates an html file with lots of hardwired code, and quite random configuration options. For instance it creates a table with white background by default (<code>&lt;table style="... bgcolor="white" ... "&gt;</code>) which can be turned off using <a href="http://jasperreports.sourceforge.net/api/net/sf/jasperreports/engine/export/JRHtmlExporterParameter.html#IS_WHITE_PAGE_BACKGROUND" rel="noreferrer"><code>IS_WHITE_PAGE_BACKGROUND</code></a> option, on the other hand <code>cellpadding="0" cellspacing="0" border="0"</code> are hardwired in the <code>table</code> tag. It is also strange (and makes css styling difficult) that instead of span classes the html file contains <code>&lt;span style="font-family: sansserif; color: #000000; font-size: 10.0px;"&gt;</code> for all my fields.</p>
  
  <p>Of course I can implement the html-output using JSP, but it means I have to design the output twice (once in jrxml for JasperReports, once in JSP), and I have to reimplement reporting functions (like subtotal calculation, total calculation, grouping ...) which is against the <a href="http://en.wikipedia.org/wiki/Don%27t_repeat_yourself" rel="noreferrer">DRY</a> principle.</p>
  
  <p>What is the best practice for implementing this? Is it possible to create a better HTML export using JasperReports?</p>