You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@poi.apache.org by "Mehner, Björn" <Bj...@epos-cs.de> on 2003/08/21 16:52:29 UTC

Excel-Sheets as Templates

Hi, everyone,

after playing a while with HSSF I wonder if there is already a solution
for my problem.
I want to use POI/HSSF in some sort of template engine for printing data
in a webapplication. Printing in Browsers always sucks so we use Excel
for printing nice layouts (actually this was not really my idea but I
have to do it ;-) ).

My goal is to read in Excel templates on request, fill the data from
Java objects in certain cells and deliver the sheet to the clients
browser. Up to now I created a class for every different layout I wanted
to print. This involves nearly one class for every page in our
webapplication and there are many of them. This is not easy to maintain
because changing the layout requires recompiling. It would be better if
changing the layout would be easier. The value objects are not supposed
to change often. So they are not a problem. But I have to store both the
template and the description how to fill it outside the program. My idea
now was to store an excel template and a XML file with a description how
to fill the excel file with data from a certain java class. But this
sounds like something somebody else might already have implemented.

Is there any template engine with (preferred) or without poi that works
in a similar way? 

I looked at cocoon, but cocoon just moves the problem a bit further on.
It uses the gnumeric format, and so I have to use a description how to
fill this format with my data and I would prefer to use Excel as
template format. Although it is horrible every troll can create an Excel
template with MS Office.

Any suggestions?

Thanks in advance!

ciao Bodo