Customising BIRT Reports

This section details how to modify BIRT within the report design or the Weave registration.

Report Customisation

We will look at the Report Label, Report Description, and Report Parameters in the report view.

Report Label

When displaying an available report to the user, Weave will use the Display Name property set in the report design to obtain the text for its label. For the Blank Report template the text for this property is "Blank Report", so that will be the text that is displayed in the Weave client's report panel.

To alter the label text we could go back to the report design, change the Display Name property and save the report design, or we can set the label directly in the report registration in the config file.

<?xml version="1.0" encoding="UTF-8"?> <config xmlns="urn:com.cohga.server.config#1.0" xmlns:birt="urn:com.cohga.server.report.birt#1.0"> <birt:report id="sample" report="reports\sample_report" label="Sample Report"/> </config>

Report Description

If you hold the mouse cursor over the report label in the report view you'll notice a description of the report popup

This can be changed by editing the report design and changing the Description in the report properties,

or you can set a 'description' property in the report registration.

<?xml version="1.0" encoding="UTF-8"?> <config xmlns="urn:com.cohga.server.config#1.0" xmlns:birt="urn:com.cohga.server.report.birt#1.0"> <birt:report id="sample" report="reports\sample_report" label="Sample Report" description="Sample for demonstrating BIRT"/> </config>

Report Parameters

Report parameters enable input from the user when it's time to generate the report, and that input can be used to alter the generated report.

This can be used to include custom text in a report or in more advanced ways by using the scripting environment within the BIRT reporting engine to make major changes to the report.

The report parameters can be seen in the Report Parameters section on the Outline panel in the BIRT report designer.

To create a new report parameter right click on the Report Parameters item and select New Parameter.

From there you can enter the detail for the new report parameter

You can now use the parameter in a report item

A simple way to add a report parameter to a report design and have it display the text is to drag and drop the parameter from the Outline view to the report design

When the user generates the report, they will be asked for the report title

which will appear in the generated report