What I am trying to do should be simple. I have never used SSRS variables before, and this is probably a very good solution. But this is not working currently for me. I have one parent report with several subreports. The parent report only returns 6 columns and in this case, just 2 rows. In both of these rows there is a column called Program, which happens to be the same value for both rows. Now I want to pass this Program value to one of my subreports. I don't know why SSRS is not letting me pass this value, but when I configured the parameter values for this subreport, I selected the parent dataset and this Program field. But when I then try to run the parent report, this subreport has the error:
Data retrieval failed for the subreport, 'Subreport1', located at: /Incoming/Risk Assessment 25mar13. Please check the log files for more information.
So then I figured that I would test this subreport by itself to see if it was the problem. But when I ran this subreport (Risk Assessment 25mar13) with the program value coming from the parent report, it generated 0 records. However, when I instead selected "All" Programs, this subreport did display data. How can I pass values from the parent report dataset to one of these subreports? I tried this expression for the Program parameter value on the subreport:
=Fields!program_providing_service.Value
But the parent report still has this error or it times out. Although when I ran this subreport with this same Program value, it rendered in just a few seconds. So I do not think the subreport is the problem.
One other note is that the parent report has one tablix. This tablix has one row group, covering the entire tablix. And this sureport occupies one of these tablix rows. This row group is grouped on a field from the parent report dataset on the "event_log_id" field. However, this subreport does not have event_log_id as one of its parameter values.
But the parent report dataset does have other values that it sends to the subreport, including the Program field value. And I know that I am sending the correct values from the Parent report to this subreport because I created expressions in a textbox on the parent report to display the first field records from the parent dataset. These field records are all UNIQUEIDENTIFier values except for one DATETIME value.
I have also tried setting the subreport parameter values to:
=First(Fields!program_providing_service.Value, "DataSetName")
for each parameter, since there are multiple records in the parent dataset.
shared dataset
for thesubreport
? – praveen