This sample shows how to customize rule reporting using the report design editor provided by BIRT.
Key Features
Key features of this sample include:
-
Creation and modification of a rule template reporting using ILOG Data source
-
Preview mode during template edition
Importing this Sample
To import the customrulereport sample:
-
Click File > Import.
-
In the Import Wizard, select
ILOG Rule Studio Samples and Tutorials then click Next.
-
Select the sample
brmanagement > customrulereport.
-
Click Finish.
-
If one or more files already exist in your workspace, a warning message is displayed indicating the file(s) were not re-imported. Close the message window.
The imported sample project files are displayed in the Rule Explorer. You should see three new projects:
-
loanvalidation-rules: A sample rule project
-
loanvalidation-xom: A sample Java project containing the execution model for the
loanvalidation_rules project.
-
custom-rule-report: A custom rule report template.
Running the Sample
You will start by modifying the report template. You then need to review the template before deploying it, and then you can us it.
To modify the report template:
-
Switch to the Report Design perspective to open the BIRT editor:
-
Click Window > Open Perspective > Other.
-
Select the Report Design perspective, then click OK.
-
In the Navigator view, double-click the custom rule report template custombusinessrulereport.rptdesign.
The custom rule report template opens in the BIRT editor view.
-
Using the BIRT editor, modify the template as needed.
For example, edit some of the fixed text, or change the default logo image.
The BIRT editor provides numerous features such as filtering data, grouping data and inserting scripts. To learn more about how to use the BIRT editor, refer to the BIRT Report Developer Guide.
You should now preview the report template. To use preview mode, you must first associate each data set with a rule project. In this sample, five data sets are defined, so we must associate each of them to a rule project, one by one.
To preview the report template:
-
In the Data Explorer view, double-click the data set Rule Packages Data Set.
The Edit Data Set dialog appears.
-
Click Data Selection in the list on the left.
-
Click loanvalidation-rules in the Data Selection list, then click OK.
-
Repeat steps 1 to 3 for each of the other four data sets:
- Rule Artifacts Data Set
-
Click File > Save to save your changes.
-
Click the Preview tab to view the modified report.
The report preview merges data from the associated data sets with the report template, and displays a preview of the final report.
In order to be able to use your customized template, you must first deploy it.
To deploy the report template, copy custombusinessrulereport.rptdesign to the following directory:
<InstallDir>/studio/eclipse/plugins/ilog.rules.reporting_*.*.*/templates/business_rule_reports
| Note |
Do not modify or delete the default template files (business_rule_report.*). To use the default template as the starting point for your own customized template, first make a copy of the default template then make changes to the copy.
|
To use the customized report:
-
Switch to the Rule Perspective.
-
Right click the loanvalidation-rules project and click Rule Report > Business Rules.
-
In the Business Rule Report wizard, click Next.
-
In the Choose a BIRT Template list, select customrulereport.
-
Click Finish.
The report is displayed in the Internal Web Browser view.
Highlights
You can also create your own customized report template from scratch. Your report must use the available ILOG Data Source in order to get the appropriate data.
The ILOG Data Source contains five data set types (Ruleflows, Rule Artifacts, Rule Packages, Parameters, Variables). Each data set you create must be one of these types. To use the preview mode, you must associate each of your data sets to a rule project stored in your current workspace.
| Note |
| A rule report can only contain data from one rule project. If you have several rule projects in your workspace, you can preview a report that contains elements from several rule projects. However, the final generated version of a rule report can only contain elements from one rule project.
|
| Notes |
You can also customize the Rule Team Server report by overwriting teamserver-report.rpdt found in jrules-teamserver-web-XXX.war/WEB-INF/lib > jrules-teamserver-web.jar/ilog/rules/teamserver/web/birt_reports and redeploying the Rule Team Server ear.However, you must use Eclipse 3.0 and BIRT 1.0.1 to modify or create teamserver-report.rpdt. Reports created in JRules 6.7 using Eclipse 3.3 and BIRT 2.2 will not work in Rule Team Server.
|
Related Tasks
Related Reference
Related Samples and Tutorials