0
votes

I have the following expression in one of the textbox in my report on Reporting Services:

=Parameters!Detalle.Value
    & IIF(Fields!Merchandiser.Value=False,"<b>Write Something: </b>" & FormatNumber(Sum(Fields!Amount1.Value, "Datasource") + Sum(Fields!Amount2.Value, "Datasource"),2) & "<br>",
    &"<b>Write Something: </b>" & Sum(Fields!Number.Value, "Datasource") & "<br>"

But Im having the following error: "The value expression of object "Textbox" of type textrun contains an error: [BC30277] the character type '&' does not coincide with the data type "Object" declared.

I think that the problem resides on where I put the & inside my conditional but Im not 100% sure.

1

1 Answers

0
votes

You have an extra & in your expression where the ELSE statement is. It's also missing an ending parenthesis.

=Parameters!Detalle.Value & 
    IIF(Fields!Merchandiser.Value=False, 
      "<b>Write Something: </b>" & FormatNumber(Sum(Fields!Amount1.Value, "Datasource") + Sum(Fields!Amount2.Value, "Datasource"),2) & "<br>",
      &"<b>Write Something: </b>" & Sum(Fields!Number.Value, "Datasource") & "<br>"

This should work:

=Parameters!Detalle.Value & 
IIF(Fields!Merchandiser.Value=False,
    "<b>Write Something: </b>" & FormatNumber(Sum(Fields!Amount1.Value, "Datasource") + Sum(Fields!Amount2.Value, "Datasource"),2) & "<br>",
    "<b>Write Something: </b>" & Sum(Fields!Number.Value, "Datasource") & "<br>")