-6

I commonly display the number of rows of my datasets in SSRS e.g.

=CountRows("MyDataSet")

However this doesn't work when the dataset is a shared dataset with a parameter.

=CountRows("MySharedDatasetWithParameter")

Instead it throws an error:

The Value expression for the textrun 'Textbox25.Paragraphs[0].TextRuns[0]' contains an error: (processing): (null != aggregateObj)

How can I get the number of rows in this case?

The dataset "MySharedDatasetWithParameter" does work in normal circumstances, because I am using it to provide the available values to another parameter.

Example of shared dataset with parameter

select [Name], [Value]
from dbo.MyList
where MasterList = @MasterList
Dale K
  • 25,246
  • 15
  • 42
  • 71
  • I would be grateful for the reasons for the downvotes. This is a clear technical issue, very useful (to me at least) and I have spent a large amount of time researching a solution. – Dale K May 26 '20 at 19:54

1 Answers1

1

A workaround taken from this answer (Its not a duplicate question else I would flag it as such) is to create a hidden, multi-valued, parameter e.g. MyHiddenDataSetValues which stores the values from "MySharedDatasetWithParameter" and then

=Parameters!MyHiddenDataSetValues.Count

gives the number of rows.

Rather clunky, so still hoping for a way to use CountRows.

Dale K
  • 25,246
  • 15
  • 42
  • 71