Robert
Robert

Reputation: 2865

How do I move subreports into their own folder?

SSSRS 2008 R2

My BIDS project has a few reports but those reports reference a large number of subreports. How do I move all the subreports into their own folder and reference them in the body of my main report?

I tried creating a folder and manually moving the subreports into it. That didn't work. BIDS couldn't find the subreports and the folder didn't appear in the project structure.

Upvotes: 1

Views: 4256

Answers (4)

SherlockSpreadsheets
SherlockSpreadsheets

Reputation: 2360

While developing in Visual Studio, you cannot use the folder path reference. If you do you will receive an error message “Could not find a part of the file path”.

For development, you will need to make sure the Subreport is in your project, then you use the dropdown to select the report. When development is complete, the Main report needs to be changed to reference the correct folder (/Sub reports/myReport.rdl) and the Subreport needs to be deployed to the correct folder (/Sub reports). This means there will be 2 copies of the sub report-- 1 in your MainReport project, and 1 in your SubReport project. Not ideal that there's two copies to keep up-to-date, but it works.

Also, if the first forward slash is excluded (Sub reports/myReport.rdl), your reference is to look in a child folder. With the forward slash at the beginning (/Sub reports/myReport.rdl), your reference path is starting from the root folder of the SSRS web portal.

enter image description here

Upvotes: 1

ozMoses
ozMoses

Reputation: 51

I've found a decent workaround by creating a symbolic link to your projects folder\bin\debug\full\subreport\path

Details and screenshots are here: http://www.andrewmosey.com/subreport-in-a-sub-folder-working-in-visual-studio-and-ssrs

Upvotes: 0

Jesse
Jesse

Reputation: 873

In case someone finds this years later. My current solution was to open the report using Report Builder. In that interface, you can set subreports to a relative path on the server and a different folder path than the main parent report. You cannot seem to do via SSDT or BIDS.

You can then download the main report into SSDT and bring it back into your project.

To run the report, you have to setup the same folder structure that the report manager has for reports in your projects Bin\Debug folder. If you do not do this, it will error asking for that folder structure to appear there.

That hack worked for me.

Upvotes: 0

Nathan Griffiths
Nathan Griffiths

Reputation: 12756

The problem here is that BIDS expects all subreports to be in the same folder as the main report, you can't use paths or subfolders.

However, when deployed to the report server relative paths (e.g. /SomeFolder/MyReport) will work and so you can alter your main report to point to reports in any subfolder or relative path and this will work once deployed. You will not be able to see the subreports in the main report when running it in BIDS though.

Upvotes: 3

Related Questions