A simple jQuery Plugin to render JasperReports files in a Web browser.
- jQuery (www.jquery.com)
- XML2JSON Library by Fyneworks (www.fyneworks.com)
- Raphaël (www.raphaeljs.com)
-
Add the required libraries:
<script type="text/javascript" src="jquery.js"></script> <script type="text/javascript" src="jquery.xml2json.js"></script> <script type="text/javascript" src="raphael.js"></script> <script type="text/javascript" src="jquery.jasperreader.js"></script> -
And bind the reader to an existing DOM element:
element.JasperReader(, ); The second parameter is a list of sections and it's optional. Renders all sections by default.
<script type="text/javascript">
$(function() {
$('#report').JasperReader('report.jrxml', [ 'title', 'pageHeader', 'detail', 'pageFooter' ]);
});
</script>
- Fix alignment issues.
- Add support for more components.
- Add support for parameters (would be nice to be able to supply a data source, too)
- It would be nice to add a designer feature with drag & drop and change tracking.