Get Count of Shared DataSet when defined with a Parameter
Asked Answered
T

1

-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
Twister answered 20/2, 2020 at 23:45 Comment(2)
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.Twister
I think this must be a catch-all question for revenge downvoting 🤷‍♂️Twister
T
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.

Twister answered 21/2, 2020 at 0:50 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.