BIRT Reporting Multi-value Report Example

Sunday, November 30, 2008

Today I've officially joined BIRT-Exchange (www.birt-exchange.com), although I have been actively developing BIRT Reports as a Java developer for over a year already.  For those of you that don't know.  BIRT is an open source Eclipse-based reporting system that integrates with Java/J2EE application to produce compelling reports.

The Official homepage is here: Eclipse BIRT Home

BIRT-Exchange is located here: BIRT Exchange

I posted my first contribution in BIRT Exchange under DEV Share


A fragment of my posting:

How to pass a Multi-value Report Parameter (List Box of Type String).

Most report examples show how to create reports with single value report parameters.  The List Box Parameter Type has the ability to allow multiple selections.   When using parameters natively in the "Parameter Tab" of a specific Dataset in the UI, you will notice that you cannot create a link to parameters with multiple values, but with only single values.  I hope to address a solution here with the solution I provide here (if there are other ways to go about this, I'd love to hear how others are resolving this issue) 

The following example attached uses the example BIRT DB as a datasource, and prompts the user with a multi-value list box as a parameter with a list of all countries.  One or more countries can be selected (multiple-selection) or the default value "All Countries" can be selected. The report essentially executes the query:

"SELECT * from customers where countries IN ( ** comma separated list of values **)" or if "All Countries" is selected, it will simply execute "SELECT * from customers"

Read more here