Pass field from one dataset to another dataset as parameter In SSRS 2008 R2

Hitesh Gupta picture Hitesh Gupta · Nov 13, 2014 · Viewed 11.4k times · Source

I have a scenario where one of my data-set returns multiple records. Now I have implemented grouping in my report so as to display each record from this data set on a different page.

Now I have an another dataset which loads some data using fields from dataset1 as parameter. That means I need to assign the fields from dataset1 to dataset2 as parameter for each record.

For a single record, we can assign the values from dataset1 to a report parameter and then use it for our dataset.

But in this case, parameter always holds the value 1st record and passes it for every page or group.

How can I achieve this?

Answer

S. Costello picture S. Costello · Aug 24, 2015

I had the same problem, where the value was always from the first record in the parent report dataset for each subreport record.

In my case, the resolution was to remove the hidden parameter that I was using in the parent report. The default value I was assigning for that parameter were results from a query.

I then went into the properties of the Subreport, selected Parameters and in the Value dropdown where I originally assigned my parent report parameter, I switched it to the field name of the parent report dataset field so that it would pass the value to my subreport parameter.

Hope this helps.