How to Scope a Subreport
Up until now, I haven't dealt with subreports in SSRS 2008. I'm having a problem trying to figure out how to get the main report and sub report scoped correctly. I have a main report that contains a single tablix. The report for my subreport was built the same way. In my main report, I have attempted to drag a subreport component onto the body of my main report. The datasource of the subreport contains a parameter called 'Region'. I have mapped this parameter to First(Region) from the dataset (DS_CensusBreakOutByRegion) in the main report. When I attempt to preview the report, I get the following error message: Warning 1 [rsErrorExecutingSubreport] An error occurred while executing the subreport 'CensusBreakOutByRegion_Sub' (Instance: 120iS0): One or more parameters were not specified for the subreport, 'CensusBreakOutByRegion_Sub', located at: /CensusBreakOutByRegion_Sub. C:\Users\cdunn\Documents\Visual Studio 2008\Projects\SSRSAdvocatReports\SSRSAdvocatReports\CensusBreakOutByRegion.rdl 0 0 So I'm not clear on whether or not I have the parameter mapped correctly, and whether or not the tablix of the main report needs to be in some other container with the subreport. Thank you for your help. cdun2
December 8th, 2010 10:31am

Additionally, I have placed the tablix from the main report and the sub report into another tablix (tablix3). With the Details Row Group, I have grouped this on Region. I have configured DS_CensusBreakOutByRegion as the DataSetName for tablix3. The report now renders in Preview, but I get the following message for the sub report: Warning 1 [rsErrorExecutingSubreport] An error occurred while executing the subreport 'CensusBreakOutByRegion_Sub' (Instance: 126iT0R0x0S0): Data retrieval failed for the subreport, 'CensusBreakOutByRegion_Sub', located at: /CensusBreakOutByRegion_Sub. Please check the log files for more information. The SQL Sever I am running against is versioned as follows: Microsoft SQL Server 2008 R2 (RTM) - 10.50.1600.1 (X64) Apr 2 2010 15:48:46 Copyright (c) Microsoft Corporation Enterprise Edition (64-bit) on Windows NT 6.1 <X64> (Build 7600: ) All of my DataSets are shared DataSets. The one that is configured to the Tablix in the main report gets its data from a SQL Server Stored procedure with a parameter of @Region. In the report, the parameter is configured to Get values from a query. This query is contained in a shared DataSet called DS_Region. The Tablix in the Subreport (named CensusBreakOutByRegion_Sub) is configured to a shared DataSet called DS_CensusBreakOutByRegion_Sub. It also has an @Region parameter, but gets its data from a text query: SELECT * FROM dbo.vw_CensusBreakOutByRegion_Sub WHERE Region = @Region I don't have 'Available Values' for the @Region parameter in this report configured (it is set to None). Does it need to be configured?
Free Windows Admin Tool Kit Click here and download it now
December 8th, 2010 2:48pm

I have deployed the reports, and the sub report renders in the Report Manager. In Visual Studio 2008 BIDS, I still get the following error message on the subreport: Data retrieval failed for the subreport, 'CensusBreakOutByRegion_Sub', located at: /CensusBreakOutByRegion_Sub. Please checked the log files for more information.
December 8th, 2010 3:52pm

Hi, Do the both main report and sub report exist in the same folder in the report manager or same project in the BIDS tool? See http://msdn.microsoft.com/en-us/library/aa337490(SQL.90).aspx on how to use subreport in reporting services. thanks, Jerry
Free Windows Admin Tool Kit Click here and download it now
December 9th, 2010 9:24pm

Yes, they are both in the same folder in the report manager and BIDS. I was able to work this out without having to use a sub report, but I have another question about driving results in two different tablix controls with one parameter. I'll make a seperate post for this. Thank you for your help cdun2.
December 10th, 2010 2:59pm

This topic is archived. No further replies will be accepted.

Other recent topics Other recent topics