#1 2019-01-17 05:56:06

twolsey
Member
Registered: 2019-01-13

Trouble with Datasource Parameters and BIRT Report

Hello

I have created a report parameter drop down in BIRT named rp_companyname. When I view the report from BIRT, the parameter selection dialog box is shown where I can select from the drop down and the report is filtered accordingly based on company name from my MySQL DB.

I am struggling to create the parameter in ReportServer to obtain the same result.

In ReportServer

1. I created a BIRT Report Datasource called "BirtReportDatasource1"
2. I selected the report ("TestMYSQLBIRTReport") and then selected "Parameters" to define the parameter for the report
3. I picked the parameter drop down and selected Datasource Parameter
4. I chose "edit" and added a name of "Company Name" and a key of "rp_companyname"
5. I selected "Specific Properties" and then I selected the Birt Datasource I created previously "BirtReportDatasource1"
6. The report "TestMYSQLBIRTReport" was already selected automatically
7. Then I selected dataset for a type and a name of "rp_companyname"
8. Select "Single Selection" and Dropdown and java.lang.String

When I run the report, I am prompted with the dropdown but it is not populated and consequently empty. Have I configured anything incorrectly above?

thanks
Tony

Offline

#2 2019-01-17 07:57:17

eduardo
Administrator
Registered: 2016-11-01
Website

Re: Trouble with Datasource Parameters and BIRT Report

Hi Tony,

datasource parameters are explained here: https://reportserver.net/en/guides/admi … atasource/
You don't need a BIRT datasource for this, just a normal relational datasource. Before using it, check you get two columns as explained in the documentation. You can create a dynamic list based on this datasource for checking the results. Then you can use this working datasource for a datasource parameter.

Regards,
Eduardo

Offline

#3 2019-01-18 03:54:31

twolsey
Member
Registered: 2019-01-13

Re: Trouble with Datasource Parameters and BIRT Report

Thanks Eduardo, I did now manage to have the drop down populate correctly and filter now based on the dropdown when I have only one parameter defined.

I did create a second parameter to give that a try.  I made the second parameter to be dependent on the first. Do I need to define cascading parameters in BIRT first to make this work or can it all be done within ReportServer?

When I run the report, I get both parameter dropdowns to choose from but when I select a value from the first dropdown, the second dropdown does not filter based on the first dropdown.

thanks
Tony

Last edited by twolsey (2019-01-18 04:58:51)

Offline

#4 2019-01-18 07:56:19

eduardo
Administrator
Registered: 2016-11-01
Website

Re: Trouble with Datasource Parameters and BIRT Report

Hi twolsey,

how did you reference parameter1 in the query of parameter2? Just marking the parameters as dependent does not automatically imply any filtering.

Usually you would write your parameter2 query as something to the extend of:

Select key_col, val_col from mytable where some_col = $P{param1}

Also, please check this: Don't forget to add myValue as a dependent parameter: "Parameter properties" -> "Depends on"

Regards,
Eduardo

Offline

#5 2019-01-19 03:42:59

twolsey
Member
Registered: 2019-01-13

Re: Trouble with Datasource Parameters and BIRT Report

thanks again Eduardo.

The two dropdowns are working correctly (i.e.: dependent) now and filtering correctly.

thank you
Tony

Last edited by twolsey (2019-01-19 04:41:19)

Offline

Board footer

Powered by FluxBB