This is a migrated thread and some comments may be shown as answers.

How to get Parameter List

3 Answers 508 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
Sumeet
Top achievements
Rank 1
Sumeet asked on 30 Nov 2011, 10:40 PM
I have created a Telerik report with parameters. Now i want to handle these parameters using custom UI. IS there any way I can get list of all the parameters in the report and their possible values(In case of drop down)?

I don't want to hard code the parameters in my webpage. I want to create page dynamically. That's why i need to have list of parameters and their possible values from the report.

thanks for the help.

3 Answers, 1 is accepted

Sort by
0
Peter
Telerik team
answered on 01 Dec 2011, 10:46 AM
Hello Sumeet,

Check out the following code snippet that illustrates how to access the report definition report parameters collection. You can iterate the collection and setup accordingly your custom report parameter area.

var report1 = new Report1();
report1.ReportParameters["Parameter1"].

Kind regards,
Peter
the Telerik team

Q3’11 of Telerik Reporting is available for download. Register for the What's New in Data Tools webinar to see what's new and get a chance to WIN A FREE LICENSE!

0
Sumeet
Top achievements
Rank 1
answered on 05 Dec 2011, 10:56 PM
Peter,

Thanks this was really helpful....

But I am still having one issue. How I will get all the available parameter values. For example if I have a parameter where I have to select one state. How can I get all the possible values of state on the webpage. And once I select the state it will refresh the possible available values of another Parameter City.

Example:   I have A report with following Parameter:

Client:   (Dropdown having list of all the clients)
State:   (Dropdown populated after you select client. It is having only states where client operates)
City:     (Drop Populated after you select state. It is having only city of the state where client operates)

I have tried
report1.ReportParameters["Parameter1"].AvailableValues

but it gives me "Telerik.Reporting.SqlDataSource" not the values. I might be over looking something.

Thanks for your help.
0
Peter
Telerik team
answered on 07 Dec 2011, 11:16 AM
Hello Sumeet,

Generally you can't use our declarative datasource components to populate your custom UI controls. Instead for custom UI controls you can utilize the SqlDataSource Web Server Control.

Greetings,
Peter
the Telerik team

Q3’11 of Telerik Reporting is available for download. Register for the What's New in Data Tools webinar to see what's new and get a chance to WIN A FREE LICENSE!

Tags
General Discussions
Asked by
Sumeet
Top achievements
Rank 1
Answers by
Peter
Telerik team
Sumeet
Top achievements
Rank 1
Share this question
or