I’ve been checking out how to add headers and footers to Velocity but am unable to find anything in the documentation about it. Am sure I am missing something as this would seem essential to a report generator; would anyone be able to let me know what I am missing?
Velocity is not a classic reporting generator like jasper or crystal reports. It’s primarily function is to fill data into a template and use that to generate PDF.
But the parser supports @page extensions that allow you to define header and footer - search for CSS @page for more info.
It also supports a special property “-fs-table-paginate: paginate;” that allows you to repeat a table header on multiple pages as well.
See the attached PDF (with header and footer repeated on each pages, as well as table header) and here’s the significant part of the template that generated it:
Note in particular the @page definition and div.header/div.footer and how they are placed:
Thanks for the example Patrick, a very nice example. Is Velocity your preferred tool for formatted reports. in Servoy? I’d be interested to know how you rank it compared to Jasper and other contenders.
Which has the best functionality for outputting reports in formats other than PDF?