I have a need to generate an excel sheet report which looks like the following template --
I know this can be done using libraries like JExcelApi
and Apache POI
. However I would like to know if there are means of accomplishing this by writing a template similar to writing Apache Velocity
templates for sending emails.
If there is a standard, good-practice approach for generating such reports what is it?
The first of our absolute Excel best practices is to choose an organization standard before developing your spreadsheet. Stick with it for as long as you’re using the spreadsheet. An organization standard sets the stage for all future users who end up working with the spreadsheet.
All the three tools include a WYSIWIG editor with report previewing capabilities. BIRT Report Designer and Jaspersoft Studio are tools built on Eclipse RCP. This is a good point for most of us Java developers, as we might be familiar with the Eclipse environment.
You can create excel sheet via java code using apache poi library classes like HSSFSheet, HSSFRow.
The best solution is to use Javascript clients to render reports directly into an HTML element. For BIRT, the Javascript client is Actuate JSAPI and for Jasper Reports, we should use JRIO.js
Why not create a styled template using Excel? Use placeholders (like ${name.of.field}) for the values that should be substituted, but otherwise style everything as required. Use a different placeholder to mark the end-of-template (this will allow you to write comments or other data beyond this space, to document your template).
Then, either via JExcelApi or Apache POI,
Template modification will be extremely easy. The only problem is keeping the field-names in sync.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With