SSRS Hyperlink dual parameters errors

I am trying to pass a hyperlink in SSRS to open a new SSRS report (in pdf) from a text box. It is currently set up and works passing a single parameter :

="http://servername/ReportServer_REPORTS16/Pages/ReportViewer.aspx?%2fdummy%2fDocuments%2fCertificate+of+Insurance+Issued&rs:Command=Render&PolicyNo=" & Parameters!PolicyNo.Value &"&rs:Format=PDF"

However when I add in the second parameter :

="http://servername/ReportServer_REPORTS16/Pages/ReportViewer.aspx?%2fdummy%2fDocuments%2fCertificate+of+Insurance+Issued&rs:Command=Render&PolicyNo=" & Parameters!PolicyNo.Value &"& Entitled="&Parameters!Entitled.Value &"&rs:Format=PDF"

I get an error message :

The ActionInfo.Action.Hyperlink expression for the text box ‘Textbox48’ contains an error: [BC30277] Type character '&' does not match declared data type 'Object'.

I've gone through every similar error I've found on google but cant work out where im going wrong.

1 answer

  • answered 2018-11-08 09:56 Alan Schofield

    You need to convert all your values to strings then use the + operator....

    Here'a an exmaple from one of my reports that does the same thing.

    =IIF(Fields!PackSizeDesc.Value = Nothing, Nothing, 
    "http://MyServername/ReportServer?/Brand+Value/_sub+SKU+Price+Details" 
     + "&CountryID=" + cStr(Fields!CountryID.Value)
     + "&CategoryID=" + cStr(Fields!CategoryID.Value)
     + "&RecordedPeriodID=" + cStr(Parameters!PeriodID.Value)
     + "&TMB=" + cStr(Fields!TrademarkBrandID.Value)
     + "&PriceStage=" + cStr(IIF(Fields!IsActualprice.Value = 1, 10, 11))
     + "&pm=" + cStr(Fields!PackMaterialID.Value)
     + "&pt=" + cStr(Fields!PackTypeID.Value)
     + "&ps=" + cStr(Fields!PackSizeID.Value)
     + "&psu=" + cStr(Fields!PackSizeUnitID.Value)
     + "&upp=" + cStr(Fields!UnitsPerPack.Value)
     + "&rc:Parameters=Collapsed")
    

    Note: The first line just disables the link if there is now value in a particular column. This does not render to PDF but that's not part of your issue.