March 20, 2009 at 12:46 am
Hi
Depend on the parameter value i have to choose the column value from dataset. In the textbox expression i gave
=iif(Parameters!parameter.Value="G",Fields!Gender.Value,iif(Parameters!parameter.Value="C",Fields!rcname.Value,iif(Parameters!parameter.Value="R",Fields!Religion.Value,Fields!Age.Value)))
which is not worked out. Is there any solution for this issue. Otherwise I have to deploy 10 reports for 10 different parameters.
I tried code behind function
Function GetParameterValue(ByVal parameter As String) As String
Select Case parameter
Case "G"
GetParameterValue= "Fields!Gender.Value"
Case "C"
GetParameterValue= "Fields!rcname.Value"
Case Else
GetParameterValue= "Fields!Age.Value"
End Select
Return GetParameterValue
End Function
and called this function in textbox expression which is giving just string like "Fields!Gender.Value" not the value from dataset.
Any Suggestion please.
Thank you in advance
Soundari
March 24, 2009 at 3:14 pm
What error you are getting with your iif logic?
March 25, 2009 at 6:04 am
Hi
For all parameter values I am getting Gender only
Soundari
March 25, 2009 at 7:48 am
Strange!!... Your logic is straight and simple. Are you sure, you have desired data in order to get other values out of this IIF function?
-RP
April 2, 2009 at 5:27 am
Hi
Yes I having values. Still searching the solution
Soundari
April 2, 2009 at 6:03 am
I don't why the IIF solution is not working, but may be you can try converting IIF into SWITCH and check if it works.
Here is the IIF code converted into SWITCH
=SWITCH( Parameters!parameter.Value="G", Fields!Gender.Value, Parameters!parameter.Value="C", Fields!rcname.Value, Parameters!parameter.Value="R", Fields!Religion.Value, TRUE, Fields!Age.Value )
--Ramesh
April 6, 2009 at 3:49 am
Hi
I tried with Switch. Not displaying any value. Now I added n columns for n parameters. For each Column visibility property I set the expression like
=iif(Parameters!parameter.Value="G",False,True)
Now I got my result. But still I dont Know why iif and Switch function didnt worked out
Thank You
Soundari
Viewing 7 posts - 1 through 6 (of 6 total)
You must be logged in to reply to this topic. Login to reply