SpoolTemplate (SpTpl) is a report system based on templates. It allows you to build reports from database queries using just a few lines of code. It bases each report on a set of XML configuration files and a little bit of PHP code. It gets the data to print from a database query or from global variables, and you may output the data from a custom function. Each report may contain many tables, and each table may display data from different queries. It supports page headers, page footers (with page numbering), and page and margin sizes.