Hi, I've used a commercial library before to create xlsx files and one
feature I liked was the ability to create an xlsx file as a 'template' and
then load one or more sets of results from database queries into it. I'd
love to be able to do this with POI if it's possible.

With that library, the template xlsx file was a normal xlsx file with
whatever formatting and layout you like, and where the data should go you
would put placeholders like '{{ResultSetName.ColumnName}}' that would at
runtime be replaced with the appropriate value from the ResultSet. New rows
would be added to the file for each new row in the resultset. This means
the template could be changed without changing any code. e.g. if you decide
you want a different order of columns, different formatting, an extra
'readme' sheet that's copied from the template through to the output, etc,
then you can do so without changing any code. Or even better you can give
that task to someone else that doesn't know how the code works and only
needs to understand the templating system.

I don't see anything like this in the POI documentation. Does it exist or
has anyone implemented something like this over the top of POI?

thanks,

Rory

Reply via email to