0
votes

I have mult dataset and i used expression and set the dataset as well but getting error

" The value expression for the textbox4 refers directly to the field dataex without specifying a dataset aggregate. when the report contains multiple datasets"

= Mid((Fields!Dateex.Value,3,2) + "-" + Left(Fields!Dateex.Value,2) + "-" + Right(Fields!Dateex.Value, 4),"Gas")
1
Any one plz .....Asad Amjad

1 Answers

0
votes

Your dataset "Gas" can contain 1 or more records. If you have a textbox that is not inside a tablix or other bound control then you need to tell SSRS how to deal with more than one record.

So, you need to do one of the following depending on your situation.

  1. If textbox4 is in a table/tablix/matrix etc, you need to set the dataset property of the table/tablix/matrix to Gas, you can then remove the "Gas" part from your expression
  2. If textbox4 is NOT part of a table/tablix/matrix etc, AND "Gas" only ever contains 1 record then you can change all your references from Fields!Dateex.Value to FIRST(Fields!Dateex.Value)
  3. If textbox4 is NOT part of a table/tablix/matrix etc, AND "Gas" contains more than one record then you will have to decide how you can identify the record you need, this might mean using a lookup etc. If you get to this point, edit your question and show some sample data and you report design, without this it's difficult to help you.