I have a VB.NET application with reports (using Microsoft Reportviewer).
I have searched, but cannot find a answer to my problem.
I want to show all records on the report if the reportparameter is null. I use a combobox to choose the report parameter name.
Code:Dim stringaliasnaam As String If KiesVorm.CmbAliasnaam3.SelectedIndex <> -1 Then stringaliasnaam = KiesVorm.CmbAliasnaam3.SelectedItem.ToString Else stringaliasnaam = Nothing End If Dim param1 As New ReportParameter("ReportParameterAliasnaam", stringaliasnaam) Me.ReportViewer1.LocalReport.SetParameters(New ReportParameter() {param1}) ReportViewer1.Show() Me.ReportViewer1.RefreshReport()
I set the reportparameter properties to Allow Null.
In a tablix properties I set the Filter to = isnothing(Parameters!ReportParameterAliasnaam.Value)
I make the type Boolean. I use = as the operator and the value as =false
When I run the application, I get no error messages, but the results in the report are wrong. If I select something from the combobox all records are displayed and when I select nothing the report is empty.
I want the report to display the records for the selection in the combobox and if nothing is selected I want to see all records.
Can someone please let me know what I am doing wrong ?




Reply With Quote
