Question

I'm using SSRS in SQL Server 2008 with Report Builder 3.0 and was wondering, when I add a field on my report from a dataset, why does it automatically add the First() function to it ? Instead of adding [Field] in a text box, it adds =First(Fields!Field, "Dataset")

Was it helpful?

Solution

Datasets are assumed to always be multiple rows (even though that may not always be the case). So when you drag a field to a report object that isn't meant for multiple rows - such as a textbox - SSRS needs to use an aggregate function of some sort, so that if multiple rows do come back from the dataset, the report doesn't break (since that textbox isn't made to automatically repeat itself for every row).

FIRST is chosen simply because it's least destructive; it could just as easily be SUM, AVG, or any other aggregate function.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top