The UBIK reporting module can be used to generate HTML and PDF reports from a template and a data object from within custom code.