This is a migrated thread and some comments may be shown as answers.

Count(RowNumber()) error after upgrade

1 Answer 290 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
Mike
Top achievements
Rank 1
Mike asked on 26 Mar 2010, 04:42 PM
After upgrading to the newest reporting version, a report that had been working fine previously started giving the following error:

An error has occured while processing Report '':
Unable to cast object of type 'DataObject' to type 'Telerik.Reporting.Expressions.IHierarchicalData'.

After some experimentation I found that removing the textbox in the report's footer that used Count(RowNumber()) (to display the total count of detail items) the error went away and the report worked as before.  How can I show the count without getting an error?

Thanks,
Mike

1 Answer, 1 is accepted

Sort by
0
Steve
Telerik team
answered on 29 Mar 2010, 02:31 PM
Hi Mike,

The RowNumber() function is an aggregate function itself  in Q1, so it is wrong to add it as argument to another argument function. If you want to count the records you should use Count(Fields.MyField), which would not count the records returning null, or Count(some_constant_here) which would return all records.

Thank you for bringing this to our attention. We would make the error message more user friendly, so that it is clear what is wrong.

Kind regards,
Steve
the Telerik team

Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items.
Tags
General Discussions
Asked by
Mike
Top achievements
Rank 1
Answers by
Steve
Telerik team
Share this question
or