<%@ page isELIgnored="true" %> <%@ taglib uri="cms" prefix="cms" %> Creating a Template Report

Creating a Template Report

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.

  1. Go to System > Reports under the Reporting menu. Make sure you have administrative permissions to the System page (see Setting Up Security).

  2. Click the Create Report button on the Reports main page.

  3. Check the Template Report box and click Select.

  4. Name and give a description (optional) of the report.

  5. 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).

  6. 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.

  7. 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.

  8. Click Save.