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")

有帮助吗?

解决方案

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.

许可以下: CC-BY-SA归因
不隶属于 StackOverflow
scroll top