0
votes

I have some trouble getting an IIF statement to work in SSRS. My goal is to add different actions to a field in my report, based on the value in the field Beschikbare_datum.Value. The statement actually works, but when I add the last IIF part, the rest of actions don't work anymore except for the last defined action. Any help / tips would be greatly appreciated.

My statement looks like this:

=IIF(Fields!Beschikbare_datum.Value =
"Beschikbaar","javascript:void(window.open('http://ncoi-synergy/synergytest/docs/WflRequest.aspx?BCAction=0&Type=3161&StartDate="&Fields!StartDate.Value & "','_blank'))",

IIF(Fields!Beschikbare_datum.Value = "(Voorlopig) Ingepland","MailTo:" & "[email protected]"  & "?Subject=" & "Aanpassing beschikbaarheid surveilleren "  & Fields!ExamenDatum.Value,

IIF(Fields!Beschikbare_datum.Value = "Beschikbaarheid reeds opgegeven","MailTo:" & "[email protected]"  & "?Subject=" & "Aanpassing beschikbaarheid surveilleren "  & Fields!ExamenDatum.Value, 

IIF(Fields!Beschikbare_datum.Value = "Uren / reiskosten declareren", "javascript:void(window.open('http://ogas01/synergyenterprise/docs/WflRequest.aspx?Mode=1&ID=%7b"& Fields!Declaratie_verzoek.Value.ToString & "%7d&BCAction=1','_blank'))"
    ,""))))
1

1 Answers

0
votes

Try using switch statement:

=Switch(
Fields!Beschikbare_datum.Value="Beschikbaar",
  "javascript:void(window.open('http://ncoi-synergy/synergytest/docs/WflRequest.aspx?BCAction=0&Type=3161&StartDate="&Fields!StartDate.Value & "','_blank'))",

Fields!Beschikbare_datum.Value="(Voorlopig) Ingepland",
  "MailTo:" & "[email protected]"  & "?Subject=" & "Aanpassing beschikbaarheid surveilleren "  & Fields!ExamenDatum.Value,

Fields!Beschikbare_datum.Value="Beschikbaarheid reeds opgegeven",
  "MailTo:" & "[email protected]"  & "?Subject=" & "Aanpassing beschikbaarheid surveilleren "  & Fields!ExamenDatum.Value,

Fields!Beschikbare_datum.Value = "Uren / reiskosten declareren",
  "javascript:void(window.open('http://ogas01/synergyenterprise/docs/WflRequest.aspx?Mode=1&ID=%7b"& Fields!Declaratie_verzoek.Value.ToString & "%7d&BCAction=1','_blank'))",

true,""
)

Let me know if this helps.