header-logo.png
header-logo.png

Jasper Report in an HTML Portlet with Dynamic Filters

Running Jasper Report in an HTML Portlet with Dynamic Filter Values

Jasper reports in PPM can be run only from the Advanced Reporting section or from the Report & Jobs section with the help of out of the box PPM capabilities. This blog post explains how a jasper report can be run from a PPM dashboard/page/tab like a portlet. The blog post also explains how the filter parameters on the report can be set dynamically.

Run Project Storyboard report as portlet in the Overview page:

To run a jasper report from PPM screen as a portlet, the report must be invoked using jasper report service with help of URL. As an example, we will use the Project Storyboard report. The following steps help in running the project storyboard report from the overview page with the help of HTML portlet.

1. Create a new HTML portlet with the following code:

reportUnit can be modified to the complete path of the desired report.

ParentFolderUri can be modified to the path of the path folder where the desired report is defined.
2. Click on Save and Return.
3. Add the HTML portlet to any tab on the Overview page.
4. When navigated to the respective page, the jasper report will be available to run as follows:

Run Project Storyboard report as with dynamic filters:

The following steps help you run the Project Storyboard report from the project properties page for the project in context alone.

1. Create a new HTML portlet with the following code:


Here the project internal id is fetched from the URL, stored in the variable prjID and passed to the report input control projectkey_1.
Multiple filters can be passed by appending the filter name and the value to the URL. For example,
/CSK_PRJ_ProjectStoryboard &populateProject=1&projectKey_1=500001
To pass multiple values to a multi select filter in the report, the input control can be repeated with the respected values –
/CSK_PRJ_ProjectStoryboard &populateProject=1&projectKey_1=500001& projectKey_1=500002
Property output determines the output type of the report when it run. Valid output types are pdf, html, xls, xlsx, rtf, csv, docx
2. Click on Save and Return.
3. Add the HTML portlet to any of the project layout tabs. Here the portlet is added to a custom tab created under project layout –