Hi there,
I'm adding cascading parameters programmaticaly and code works fine in Visual Studio 2008 ( Q2 2009 SP1, WebForms.ReportViewer), but in 2010 all parameters disappear when value of main parameter is choosed.
How can I make it work?
Cheers,
Yana
private void addParameters()
{
// Create prm Bearer
Telerik.Reporting.ReportParameter Bearer = new Telerik.Reporting.ReportParameter();
Bearer.Name = "Bearer";
Bearer.Type = Telerik.Reporting.ReportParameterType.Integer;
Bearer.UI.Visible = true;
Bearer.UI.AvailableValues.DataSource = new int[] { 1, 2, 3, 4 };
Bearer.UI.AvailableValues.ValueMember = "Item";
Bearer.Value = 0;
// Create prm Metric
Telerik.Reporting.ReportParameter Metrix = new Telerik.Reporting.ReportParameter();
Metrix.Name = "Metrix";
Metrix.Type = Telerik.Reporting.ReportParameterType.Integer;
Metrix.UI.AvailableValues.DataSource = new int[] { 1, 111, 1111, 2, 22, 222, 2222, 3 };
Metrix.UI.AvailableValues.ValueMember = "Item";
Metrix.UI.Visible = true;
string filterExpression = Metrix.UI.AvailableValues.ValueMember;
Metrix.UI.AvailableValues.Filters.Add(
"=" + filterExpression, Telerik.Reporting.Data.FilterOperator.In, "=GetBearer(Parameters.Bearer)");
this.ReportParameters.Add(Bearer);
this.ReportParameters.Add(Metrix);
}
public static int[] GetBearer(int bearer)
{
switch (bearer)
{
case 1:
return new int[] { 1, 11, 111, 1111 };
case 2:
return new int[] { 2, 22, 222, 2222 };
default:
return new int[] {};
}
}
I'm adding cascading parameters programmaticaly and code works fine in Visual Studio 2008 ( Q2 2009 SP1, WebForms.ReportViewer), but in 2010 all parameters disappear when value of main parameter is choosed.
How can I make it work?
Cheers,
Yana
private void addParameters()
{
// Create prm Bearer
Telerik.Reporting.ReportParameter Bearer = new Telerik.Reporting.ReportParameter();
Bearer.Name = "Bearer";
Bearer.Type = Telerik.Reporting.ReportParameterType.Integer;
Bearer.UI.Visible = true;
Bearer.UI.AvailableValues.DataSource = new int[] { 1, 2, 3, 4 };
Bearer.UI.AvailableValues.ValueMember = "Item";
Bearer.Value = 0;
// Create prm Metric
Telerik.Reporting.ReportParameter Metrix = new Telerik.Reporting.ReportParameter();
Metrix.Name = "Metrix";
Metrix.Type = Telerik.Reporting.ReportParameterType.Integer;
Metrix.UI.AvailableValues.DataSource = new int[] { 1, 111, 1111, 2, 22, 222, 2222, 3 };
Metrix.UI.AvailableValues.ValueMember = "Item";
Metrix.UI.Visible = true;
string filterExpression = Metrix.UI.AvailableValues.ValueMember;
Metrix.UI.AvailableValues.Filters.Add(
"=" + filterExpression, Telerik.Reporting.Data.FilterOperator.In, "=GetBearer(Parameters.Bearer)");
this.ReportParameters.Add(Bearer);
this.ReportParameters.Add(Metrix);
}
public static int[] GetBearer(int bearer)
{
switch (bearer)
{
case 1:
return new int[] { 1, 11, 111, 1111 };
case 2:
return new int[] { 2, 22, 222, 2222 };
default:
return new int[] {};
}
}