SSRS IIF Statement with Parameters

  • Hello,

    I am trying to write a simple IIF statement but something seems to be wrong.

    Bascially what I am trying to do is check the passed parameter and if is passed as ACME than I want it to display as "Company1" otherwise display the actual parameter value.

    = IIF(Parameters!getSource.Value)="ACME", "Company1",Parameters!getSource.Value)

    However, what I get is:

    System.Web.Services.Protocols.SoapException: The Value expression for the textrun ‘Textbox15.Paragraphs[0].TextRuns[0]’ contains an error: [BC30455] Argument not specified for parameter 'FalsePart' of 'Public Function IIf(Expression As Boolean, TruePart As Object, FalsePart As Object) As Object'.

    at Microsoft.ReportingServices.Library.ReportingService2005Impl.SetReportDefinition(String Report, Byte[] Definition, Guid batchId, Warning[]& Warnings)

    at Microsoft.ReportingServices.Library.ReportingService2010Impl.SetItemDefinition(String ItemPath, Byte[] Definition, String expectedItemTypeName, Property[] Properties, Warning[]& Warnings)

    at Microsoft.ReportingServices.WebServer.ReportingService2010.SetItemDefinition(String ItemPath, Byte[] Definition, Property[] Properties, Warning[]& Warnings)

    I am grateful for any help

  • You have:

    = IIF(Parameters!getSource.Value)="ACME", "Company1",Parameters!getSource.Value)

    Remove the parenthesis after ".Value":

    = IIF(Parameters!getSource.Value="ACME", "Company1",Parameters!getSource.Value)

    "I cant stress enough the importance of switching from a sequential files mindset to set-based thinking. After you make the switch, you can spend your time tuning and optimizing your queries instead of maintaining lengthy, poor-performing code."

    -- Itzik Ben-Gan 2001

Viewing 2 posts - 1 through 1 (of 1 total)

You must be logged in to reply to this topic. Login to reply