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

Creating a Velocity Report

Velocity Reports use a Velocity template unique to each report to deliver the content. Velocity Reports are good for customizing the UI, as they can automatically be made available on the Build Life page. Once created, Velocity Reports can be run directly from the Build Life Reports tab.

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.

For advanced users, the Apache Velocity Project provides numerous resources that may be of benefit.

  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 Velocity Report box and click Select.

  4. Configure report:

    • Name the report.

    • Description. Provide a description.

    • Content Type. Optionally, you can give the MIME type of the report content. This will be sent to the browser when the report content is generated. E.g.: text/plain, text/csv, or text/html.

    • Publicly Available. Check the box to make the report URL available without having to login to AnthillPro. This is helpful for managers, executives, etc., who need to view the report.

    • Integrations. Check the box to select the UI integration points for this report. When integrated, the report will be available directly in the UI and the context script will be passed to the Build Life as 'buildLife'.

    • Context Script. Give an optional BeanShell script to populate the context of the template. The script should return a Map object as the context for the Velocity template to render. This script will be passed all request properties when it is run, as well as a Map object called 'context'.

    • Template Text. Input the BeanShell script that creates the report and returns a ReportOutput object. This script will receive the inputs that were defined as parameters. 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".

  5. Click Save.