Jump to: navigation, search

Null Report Parameter Passed to Data Set (BIRT)

Revision as of 15:03, 12 April 2007 by Jweathersby.actuate.com (Talk | contribs) (New page: {{Backlink|Report Developer Examples (BIRT)}} This example is [https://bugs.eclipse.org/bugs/show_bug.cgi?id=182197 Bugzilla ID 182197]. If you would like to contribute an example see the...)

(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)

< To: Report Developer Examples (BIRT)
This example is Bugzilla ID 182197. If you would like to contribute an example see the example contribution guidelines.


This example illustrates handling a null report parameter before using it in a data set parameter.

BIRT Version Compatibility

This example was built and tested with BIRT 2.1.2.

Example Files

Example Report Zipped


BIRT Supports Report Parameters and Dataset Parameters. A Report parameter can be setup to accept null values. JDBC Dataset parameters are created when using the ? within the SQL Editor. The dataset parameter is then linked to a report parameter in the dataset editor (Parameters entry). This works fine unless the parameter is null. To deal with this problem you can tie your report parameter to the dataset in the beforeOpen event handler for the dataset. In the attached example the query that is used is as follows:

select *
from orderdetails

So the default query is looking for null order numbers. The report also has a parameter that has the allow null check box checked. In the beforeOpen script for the dataset the following is entered.

if (params["NewParameter"].value){
           this.queryText = "select * from orderdetails where CLASSICMODELS.ORDERDETAILS.ORDERNUMBER =" + params["NewParameter"];

If the report parameter is null this code will not be executed. If the parameter is not null the query is altered to append the parameter to the where clause.


Please enter comments below by selecting the edit icon to the right. You will need a Bugzilla account to add comments.