Recently there is a reader asked about how to display row count information in page footer if no data returned. Since RowNumber() function can only be used in the report body to retrieve the number of rows in the specified scope, we could not use it in either the Header or Footer area.
We could use other counting function such as CountRows() or Count() to retrieve the number of rows retuned for the dataset.
Here is what we can do:
- Add a textbox in the report footer
- Use CountRows() function passing in the dataset name in the expression for the textbox as:
Result
AS you could see, the report footer shows the number of row returned by the dataset now.
Reference:
http://msdn.microsoft.com/en-us/library/dd255237(v=sql.110).aspx
http://msdn.microsoft.com/en-us/library/ms157163(v=sql.110).aspx
http://msdn.microsoft.com/en-us/library/ms156330(v=sql.110).aspx
No comments:
Post a Comment