Search code examples
sqlbirt

How to load parameter data based on the selection of another parameter?


I´m using BIRT Report Designer to create a report to obtain data of different tables.

Table 1:

ExhibitorStore:

  • IDExhibitor
  • IDStore
  • NameExhibitor

ExhibitionProduct:

  • IDExhibitor
  • IDStore
  • IDProduct

Each store have different exhibitors, and each exhibitor have different products.

So, I'm creating a BIRT that has a select list, that show a list of stores, and another select list that show the list of the exhibitors that belong to store.

I couldn't find a way to make that dynamic, when I change the store in the select list, change the list of exhibitors that belongs to the store.

BIRT1

This is image when I run the BIRT with default select option of stores, the exhibitor shows is right.

BIRT2

This is image when I run the BIRT with default select option of stores, and change value of select. The options of exhibitors not change.

But if I change the option of the select show for default and I run the BIRT, show the exhibitors of the store that show for default.

BIRT3

BIRT4

Should I define some property in the parameter "Store" so that when change the option of the select list of store, the select of exhibitor is refreshed?

BIRT5


Solution

  • To achieve this behavior you have to create a cascading parameter group

    enter image description here

    You can download an example here: https://download.eclipse.org/birt/downloads/examples/reports/2.1/cascade/cascade.rptdesign

    A cascaded parameter group allows a group of parameters to be interlinked, where selecting a value for the first parameter affects the choices available in the subsequent parameters. Cascaded parameters can be tied to one or more Data Sets. The Data Sets populate each level of the cascade. Combined with Data Set parameters this offers very good flexibility for culling of returned data for a report.