Search code examples
reporting-servicesssrs-2008

Correctly wrap double quote to SSRS report parameter


I am not working on a SQL report and one value needs double quotes added on both side. The definition of this value is like the following:

<Value>=Parameters!ParamSearchTerm.Value</Value>

I've tried with some solutions such as adding """ on both sides or add char(34) on both sides, however they don't work.

This is how I've done with Char(34):

<Value>=Parameters!Char(34)+ParamSearchTerm.Value+Char(34)</Value>

The result shows an error: The value express for the query parameter @ParamSearchTerm refers to a non-existing report parameter 'Char'.

I've also tried with lower case char, still not working.

enter image description here


Solution

  • 1ST SOLUTION:

    <Value>= "'" +"'" + Parameters!ParamSearchTerm.Value + "'" + "'"</Value>
    

    This will shows like a double quote but I know this is not the best way just an alternative way.

    2ND SOLUTION:

    =Chr(34) & "Parameters!ParamSearchTerm.Value" & Chr(34)
    

    or

    =Chr(34) + "Parameters!ParamSearchTerm.Value" + Chr(34)
    

    3RD SOLUTION

    ="""Parameters!ParamSearchTerm.Value"""
    

    Hopes I help.