Hi, Sounds like a useful tool. I don't know of such a project already existing, but it should be quite straightforward with the POI interfaces.
A related project is https://github.com/centic9/poi-mail-merge which does a similar thing for providing mail-merge for word-documents, although it needs to use a bit lower-level interfaces to do the replacements. For Excel files you should be able to use the normal high-level interfaces to look through the contents of the template, replace/insert all necessary things and write the result to a new document. On Mon, Jul 27, 2015 at 11:12 AM, Rory Kingan <[email protected]> wrote: > 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 --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
