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

Multiselect Blank Values

1 Answer 69 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
Jeff
Top achievements
Rank 1
Jeff asked on 18 Oct 2012, 05:08 AM
I have a multi-select Visible report parameter with AllowBlank set to True. When the user de-selects all values in the multi-select, they get a validation error indicating that the parameter is required. Why is this?

Note, if I select AllowNull for the parameter, I get a "NULL" checkbox next to the parameter in the UI, which looks completely ridiculous. I don't want to set it to NULL, I just want to not select any values...

How can I fix this?

1 Answer, 1 is accepted

Sort by
0
Peter
Telerik team
answered on 22 Oct 2012, 03:13 PM
Hello Jeff,

The Report Parameter area provides out of the box UI support for the parameters that covers most of the user cases and for that reason it is not highly customizable. Keep in mind however that the NULL text may be changed to some more appropriate term from your application domain (see Report Viewer Localization).

If still that does not fit your UI requirement, you should create custom UI for the parameters (for example using our Controls) and hook it up to the parameters via the Reporting API as shown in the following code snippet: 

protected void Page_Load(object sender, EventArgs e)
{
    var instanceReportSource = new InstanceReportSource
    {
        ReportDocument = new Invoice()
    };
    instanceReportSource.Parameters.Add("MultiValueParameter", new object[] { 1, 2 });
    instanceReportSource.Parameters.Add("SingleValueParameter", "my value");
    ReportViewer1.ReportSource = instanceReportSource;
}

Protected Sub Page_Load(sender As Object, e As EventArgs)
    Dim instanceReportSource = New InstanceReportSource() With { _
        .ReportDocument = New Invoice() _
    }
    instanceReportSource.Parameters.Add("MultiValueParameter", New Object() {1, 2})
    instanceReportSource.Parameters.Add("SingleValueParameter", "my value")
    ReportViewer1.ReportSource = instanceReportSource
End Sub
Regards,
Peter
the Telerik team

HAPPY WITH TELERIK REPORTING? Do you feel that it is fantastic? Or easy to use? Or better than Crystal Reports? Tell the world, and help fellow developers! Write a short review about Telerik Reporting and Telerik Report Designer in Visual Studio Gallery today!

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