0

I have a report with a parameter. The parameter value can be passed from my Application. If the parameter is not passed from UI, it is considered as NULL. I am using IndexOf() on that parameter. Since it is null i am getting error. I want to set parameter as some value if it is NULL. Is it possible ?

user3403111
  • 65
  • 2
  • 9
  • You can try: `IIF(ISNOTHING(Parameters!YourParam.Value),"Your Default Value When Null", "Your Value when not null")`. If you need further help include the expression you are using on the parameter. – alejandro zuleta Nov 18 '16 at 15:39
  • I am using this expression in Parameter Expression. But still facing the issue =IIF(IsNothing(Parameters!DataColumn.Value),"12345",Parameters!DataColumn.Value) – user3403111 Nov 18 '16 at 15:45
  • 1
    Let me understand... where are you using that expression? You can't assign a parameter to its own value, i.e you can't assign parameter A to parameters!A.Value. The simplest solution to your problem is set a Default Value for your parameter under Report Parameter Properties / Default Value tab. – alejandro zuleta Nov 18 '16 at 15:49
  • after adding expression for a parameter, if i pass null, i can get the correct value in profiler.. check datacolumn.But still getting error in Report exec spRptPointsSummary_AccessLevel @CasinoId=NULL,@StartDt='2015-11-17 00:00:00',@EndDt='2016-11-18 00:00:00',@BucketGroupId=NULL,@DataColumn=N'1,2,3,4,5',@EmpId=25 – user3403111 Nov 18 '16 at 16:06
  • What's the exact error? – SS_DBA Nov 18 '16 at 16:10

0 Answers0