Template Reports are good for generating tabular data in output such as HTML, CSV, and RSS -- all supported by AnthillPro. To generate a report, you will need to write a report script that returns the content of the report. In addition, you will also need to make sure the content matches one of the report-template types, otherwise the contents may not display properly. Because column names and numbers are determined by the report scripts, a single report template may be used by many report scripts.
Detailed instructions, including examples, on writing Report Scripts is available. To view the documentation, go to Tools and download the Development Kit Bundle. In the scripting directory, open Scripting.pdf and scroll down to the Reporting Scripts section. Urbancode also maintains a publicly available list of report and report-template scripts that may be helpful when writing a custom report. They are viewable here. |
If one of the standard template types does not meet your needs, AnthillPro allows you write your own Report Template.
Go to System > Reports under the Reporting menu. Make sure you have administrative permissions to the System page (see Setting Up Security).
Click the Create Report button on the Reports main page.
Check the Template Report box and click Select.
Name and give a description (optional) of the report.
Publicly Available. Check the box to make the report URL available to people who do not have AnthillPro login permissions (e.g., a manager, executive, etc).
Meta-Data Script. For the most
part, this script is just responsible for listing the columns that will
be used by the report. Enter a BeanShell script that should return a
ReportMetaData
object which describes the inputs to the
Report Script below, as well as the data fields of the report
itself.
Report Script. Enter a BeanShell
script that creates the report and returns a ReportOutput
object. This script will receive the inputs that were defined as
parameters in the Meta-Data Script above. All the inputs will be passed
to the script as parameters with their respective names. The
ReportMetaData
object will also be supplied to the script
as the parameter "metaData". The key thing is to create a
ReportOutput
object using the meta-data created in the
script above and add ReportRows
to it.
Click Save.