imagereporting-servicesconditional-statementsexpressioniif

SSRS Expression to Open Specific Report


I have a SSRS dashboard that has a calender image on it and under the image properties I have an action to Go to Report and a specific report was listed. Depending on the measure the user is looking at in the dashboard when they click it a 12 or 24 month trend chart will load. It works fine when I just have it set to go to a specific report but when I put an expression into the Specify a Report option I get a weird error that I have been researching but the error seems possibly misleading so I thought I would just put the expression I am using out here to see if anyone has any direction for me as it seems like what I am trying to do is simple but I may be searching wrong. Thanks in advance!

I have the expression opening the 24 month chart of the definition type is CSH and eventually it will check for other conditions but I wanted one to work before I went on.

=IIF(Fields!MEAS_DEFINITION_TYPE = "CSH","FITDash_Trend24mo.rdl",Nothing)

I get this error and it started up after I added the expression above. The datatype of MEAS_DEFINTION_TYPE is nvarchar(25):

Severity Code Description Project File Line Suppression State Error [rsCompilerErrorInExpression] The ActionInfo.Action.Drillthrough.ReportName expression for the image 'Calendar25' contains an error: [BC30311] Value of type 'Microsoft.ReportingServices.ReportProcessing.ReportObjectModel.Field' cannot be converted to 'String'.


Solution

  • Common mistake, you have forgotten to specify the .Value property of the field

    Try

    =IIF(Fields!MEAS_DEFINITION_TYPE.Value = "CSH","FITDash_Trend24mo.rdl",Nothing)