Hi There
I'm having a datatable prepared from the business layer and i need to use that for report parameters. But i am having hard time binding a column in that parameter.
Consider that i want to bind the (ProductId, ProductName) first & second column of the datatable to this report parameter and i want it to show all the row data as a multi value
But as soon as i add this binding, and while executing the report gets empty and not even shows the rest of the report and when i remove the parameter addition and just binds the report and render all the data
I tried a work around to show the dropdown parameter in report viewer by doing the below code snippet instead.
And now it shows the report and also the report parameter dropdown but with all the product name separated by semicolon in the value as it is coded to set as value (not as datasource) but i can only edit them but instead i want it to be a set of checkbox in the pulldown box of dropdown so that user can easily select them (as it would appear when i assign the datasource in design time).
Software Details
Please guide me a way to assign datasource to parameters dynamically. Thanks in advance. I greatly appreciate a sooner response.
I'm having a datatable prepared from the business layer and i need to use that for report parameters. But i am having hard time binding a column in that parameter.
Consider that i want to bind the (ProductId, ProductName) first & second column of the datatable to this report parameter and i want it to show all the row data as a multi value
public RegistrationSummaryReport() |
{ InitializeComponent(); |
DataView source = getDataSource(); |
this.DataSource = source; |
ReportParameter param = new ReportParameter(); |
param.Name = "paramEP"; |
param.Type = Telerik.Reporting.ReportParameterType.String; |
param.UI.AvailableValues.DataSource = source; |
param.UI.AvailableValues.ValueMember = "=Fields.ProductId"; |
param.UI.AvailableValues.DisplayMember = "=Fields.ProductName"; |
param.UI.MultiValue = true; |
param.UI.Visible = true; |
this.ReportParameters.Add(param); |
But as soon as i add this binding, and while executing the report gets empty and not even shows the rest of the report and when i remove the parameter addition and just binds the report and render all the data
I tried a work around to show the dropdown parameter in report viewer by doing the below code snippet instead.
public RegistrationSummaryReport() | |
{ InitializeComponent(); |
|
DataView source = getDataSource(); | |
this.DataSource = source; | |
List<string> eps = new List<string>(); | |
foreach (DataRowView dr in source) | |
eps.Add(DataUtility.MakeNullEmpty(dr["ProductName"])); | |
ReportParameter param = new ReportParameter(); | |
param.Name = "paramEP"; | |
param.Type = Telerik.Reporting.ReportParameterType.String; | |
param.UI.MultiValue = true; | |
param.UI.Visible = true; | |
param.Value = eps; | |
this.ReportParameters.Add(param); |
And now it shows the report and also the report parameter dropdown but with all the product name separated by semicolon in the value as it is coded to set as value (not as datasource) but i can only edit them but instead i want it to be a set of checkbox in the pulldown box of dropdown so that user can easily select them (as it would appear when i assign the datasource in design time).
Software Details
- Windows XP sp2
- Telerik Reporting Q1 2009
- Visual Studio 2008
Please guide me a way to assign datasource to parameters dynamically. Thanks in advance. I greatly appreciate a sooner response.