Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Error 'the subreport could not be found at the specified location. Please verify that the subreport has been published and that the name is correct'

I am getting the above error while creating a report in SSRS. I am trying to get 2 data sets from 2 databases, and I did so by creating a master report with data from Dataset1, and a subreport with another dataset.

The error goes away when I create a subreport of the same dataset. Any ideas on what I might have done wrong?

See below screenshots:

Same dataset

same dataset

The error happens when I do the following:

enter image description here

enter image description here

like image 776
ShaunK Avatar asked Jul 08 '13 19:07

ShaunK


People also ask

What is subreport in SSRS?

A subreport is a report item that displays another report inside the body of a main paginated report. Conceptually, a subreport in a report is similar to a frame in a Web page. It is used to embed a report within a report. Any report can be used as a subreport.

How do I use subreport in Rdlc report?

Right-click on the Subreport and select Properties. Set the Subreport name as EmployeeDetails, as shown below. Go to Parameters and set the Name field as ID and select the ID from the dropdown in the Value field.


2 Answers

Generally speaking from what I have seen SSRS has THE WORST ERRORS KNOWN TO HUMANKIND on telling you what is wrong. Generally speaking I have seen this one and the main culprit is one of three things:

  1. The Project needs to be rebuilt as you made changes to a subreport and the report data is not current.
  2. The Report data is corrupt some how and needs to be erased (look in your FILE location and delete the *.rdl.data file.)
  3. Your parameter you are passing in is bad or in the wrong format. All Subreports having parameters NEED TO HAVE THEM PASSED IN, or they will not run and give an error the equivalent of 'object set to an instance of a null'.

When you insert a 'Subreport' you may right click and select 'properties'. It has a 'Parameters' side panel you need to select and you need to 'Add' (for each one in the correct order and type) a 'Name' (the parameter name of the report) and the matching 'Value' from the current report passed into it.

EG: So if I had a subreport that wanted a customer to show demographic info on them and I had a master report that had rows of Business data with a customer id each per row. If my subreport took a 'CustomerID' parameter I would have that for the Name and choose '[Customer_ID]' from the current Dataset to pass to it.

You must keep in mind you must 'Add' each seperate parameter that the sub report requires.

like image 79
djangojazz Avatar answered Sep 22 '22 03:09

djangojazz


Delete all the *.rdl.data from your project solution folder.

like image 34
Jaydeep Shil Avatar answered Sep 22 '22 03:09

Jaydeep Shil