locked
Expression returned a data type not valid RRS feed

  • Question

  • This is about the simplest thing I've tried to do in many years.  I get the correct answer, but am getting a warning that, in my opinion, shouldn't be there.

    I'm trying to do a simple count of the number of rows being returned to my report.  Nothing to it.

    The dataset has two columns in it; one is an id, and the other name.  How much simpler could it be?

    I have tried two different functions / expressions, and get the same result.  The one I'm using right now looks like this:

    CountRows()

    As I said before, I'm getting the correct count on the report (there are 17 rows in the dataset - simple by design), but I see the following warning:

    [rsAggregateOfInvalidExpressionDataType]  The Value expression for the textrun 'Textbox13.Paragraphs[0].TextRuns[0]' uses an aggregate function with an expression that returned a data type not valid for the aggregate function.

    What?

    I'm not concerned with datatypes.  I'm not trying to do any kind of math or logical operation; I simply want an accurate count of the output rows.  In a very small dataset like this, I can manually verify, but if it were a large set, I would be uncomfortable with the results because of the warning.

    What am I doing wrong, and how can it be corrected?

    Thursday, August 9, 2012 8:07 PM

Answers

  • Convert the result to string and see if it removes the warning!

    And make sure your count is really on the textbox13. 

    I often searched problems in the wrong cell hehe

    Also, there is a function that I always use in ssrs 2008 that never gave me a warning to count rows.

    It is:

    =Count(Fields!YourField.Value, "YourDataset")

    Alex

    Thursday, August 9, 2012 8:37 PM

All replies

  • Convert the result to string and see if it removes the warning!

    And make sure your count is really on the textbox13. 

    I often searched problems in the wrong cell hehe

    Also, there is a function that I always use in ssrs 2008 that never gave me a warning to count rows.

    It is:

    =Count(Fields!YourField.Value, "YourDataset")

    Alex

    Thursday, August 9, 2012 8:37 PM
  • Thanks, Alex!

    Changing the function to Count, as you suggested, solved the problem.

    Much appreciated!

    Dale in Cbus

    Monday, August 13, 2012 2:40 PM