Text input via SSRS parameter, including field name

I have a report type like "SSRS" that has a common layout for text fields and tables. For the main text field, I want the user to pass a value as a parameter so that the text can be customized, i.e.

Parameters!MainText.Value = "Dear Mr.Doe, Here is your statement."

then I can set the value of the text field as the value of the parameter:

=Parameters!MainText.Value

However, I need to be able to allow the incoming parameter to include the data set field, for example:

Parameters!MainText.Value = "Dear Mr.Doe, Here is your [Fields!RunDate.Value] statement"  

so that the output of my report looks like this:

"Dear Mr. Dee, here is your expression in November."

I know that you can define it for this in a text field by putting static text and a field request, but I need SSRS to recognize what is inside the string There are request fields which should be escaped and connected.

- ? SSRS 2008R2

+3
3

. , , :

  • . , , , String.Replace() , . , . . :

    Public Function TestGlobals(ByVal s As String) As String
       Return Report.Globals.ExecutionTime.ToString
    End Function
    

    . .

    1.5 , . Visual Studio

  • XML. , , XML .rdl/.rdlc.

  • , ReportBuilder. , , SSRS.
+1

?

! MainText.Value = " Mr.Doe, " [Fields! RunDate.Value] "statement"

+1

: .

: , , RunDate " " (RunDate). RunDate, . . Date/Time, .

, , :

Parameters!MainText.Value = "Dear Mr.Doe, Here is your [Parameters!RunDate.Value] statement"

, , . , . Datetime:

="Dear Mr.Doe, Here is your " & Format(Parameters!RunDate.Value, "MMMM") & " statement"

, .

, : , , String Replace.

: : 2 MainTextBeforeRunDate MainTextAfterRunDate.

:

=Parameters!MainTextBeforeRunDate.Value & Fields!RunDate.Value & Parameters!MainTextAfterRunDate.Value.

. , . , , RunDate .

+1

All Articles