views:

1063

answers:

1

I am having an SQL reporting server reports which has 5 parameters which is nullable values. user may enter values for any of the fields. I need to check the condition that user have to enter atleast any one parameter out of five parameter values(any one is required).

**Note: I need to do this in SQL Server reports itself.**

Please suggest me some good answer

Thanks

+1  A: 

What would you like to do if you detect they haven't entered any values?

You code write some code for the report (Report Menu -> Properties -> Code). The code would check to see if at least one of your parameters is not null. Then you could use that code to show or hide a textbox to display a message.

Same code:

Public Function CheckForNoParameters(Param1 As String, Param2 As String, Param3 As String) As Boolean
    CheckForNoParameters = (Param1 = Nothing)  AND (Param2 = Nothing) AND (Param3 = Nothing)
End Function

Then in the hidden expression of your box:

=Not Code.CheckForNoParameters(Parameters!Report_Parameter_0.Value, Parameters!Report_Parameter_1.Value, Parameters!Report_Parameter_2.Value)
Ray