SSRS subfolders in Visual Studio Report Server Project - reporting-services

I am using SSRS 2008. Currently everything works find so long as I put all reports in the Reports folder of the Report Server Project in Visual Studio.
I attempted a work-around, which is to have multiple Report Server projects, each pointing to a different folder on the report server. This has the side effect of not letting me reference the sub report from another project.
So, is there a way of referencing a sub-report from another project and still have the ability to preview?
Is there a way to get sub-folders in Report Server project?

it's not built-in to SSRS; but there is a workaround. Simply keep the reports under one project (to allow the reference) and manualy control the deployment location per report.
If you go this route, you may want to look automating this by creating a deployment script using rs.exe
rs.exe
There are also some attempts at solving this on codeplex; but I haven't had a chance to take a look at this yet:
rsbuild

I know it's a long time since the question was first asked but, if anyone is looking for an answer these days like me here's what I was able to do.
Move all your reports into whatever folder structure you want.
Then edit your .rptproj file and find where your report item group is. It will look something like:
<ItemGroup>
<Report Include="Report1.rdl" />
<Report Include="Report2.rdl" />
</ItemGroup>
Just update those file names to be the full path like this:
<ItemGroup>
<Report Include="Folder1/Report1.rdl" />
<Report Include="Folder2/Report2.rdl" />
</ItemGroup>
Reload your report project and it works.... (well it does for me!)
So far everything seems to work for me.

When deploying your SSRS Report to SubFolders do the following:
TargetReportFolder => /Institutional Statements/Monthly Statements
Institutional Statements being the master folder for your solution
and Monthly Statements being the child folder within them.

Related

Is there a way to publish main and sub SSRS reports using report builder?

Dears,
I am quite new with Report Builder, and also with SSRS so sorry in advance if I raise irrelevant questions. My goal, essentially, is to deploy a sort of SQL Monitoring dashboard (I just uploaded a demo picture of it, here the link 1 ), that is composed by a main report with some charts and toggled sub reports. All these sub reports are filtered by the SQL instance name, and other parameters like number of monitoring days, months etc...
Plus I make use only of shared datasets.
Now, if I deploy the whole solution with Visual Studio against my report server, it works perfectly and all the report parts are uploaded without any issue against the report site.
If I try to deploy the report using the report website manager (by trying to upload the whole solution file by file), it does not upload anything, even if I create first the data source and then trying to add the existing datasets.
If I try to deploy the solution with Report Builder (after having giving to it the target report server URL and an existing folder that starts with slash), the only option I have is to open the solution as file, and save it against the target report server configured. But then the annoying error appears even if I the path has less than 260 char and even if the path starts with the slash:
"Error: The path of the dataset "" is not valid. The full path must be
less than 260 characters long; other restrictions apply. If the report
server is in native mode, the path must start with slash.
(rsInvalidItemPath)"
What am I doing wrong? I thought that a tool like that, used also for publishing, would make the life easier, but apparently I may not know exactly how to use it.

Long list of parameters in SSRS

I have a report with a list of customers passed in as a parameter. This list has become quite large and found it hit the limit imposed by MaxHttpCollectionKeys. I've found this documented in several posts, but I now have a more specific issue.
I have set this a lot higher in the SSRS web.config file which has solved the problem when I access the report via the report manager (ServerName/Reports). However this doesn't solve the problem when I render via the report server (ServerName/ReportServer).
I do need to access these reports via the report server as we pass some hidden parameters through from our App, as well as having some user selectable parameters. Searching for the solution only gives me posts related to the original solution which I've found.
Does anyone else have any ideas on solutions for this.
Many thanks.
Ok found solution.
I didn't realise there are two web.config files. One for the manager, one for the server. These both needed to have the mod made. Needed to add the following code to the web.config file in
C:\Program Files\Microsoft SQL Server\MSRS10.MSSQLSERVER\Reporting Services\ReportServer
Between the < system.web > and < runtime > tags.
<appSettings>
<add key="aspnet:MaxHttpCollectionKeys" value="20000" />
</appSettings>

Using external assembly's method's results as a dataset

Using SQL2008R2:
I am trying to create a dataset that is simply the result of an external assembly's return method(s), but everything I can find regarding using custom/external assemblies just has a textbox's value set to the external assembly's method's result via an expression.
I simply want Report Server to do the data processing in the external assembly and bind that result to a very simple report.
I found some references to something about MDX but they seem to be a few years outdated and needed to know if this is possible.
Assuming you already have a .dll - Place your dll in the report designer folder (where your RDL is) and the report server folder, somewhere around here:
Program Files\Microsoft Visual Studio 8\Common7\IDE\PrivateAssemblies
Program Files\Microsoft SQL Server\MSSQL.3\Reporting Services\ReportServer\bin
Now add a reference to your dll from your report.
With your report open go to Report, Report Properties, References, Add reference, browse to your dll and add it.
Now in a text box properties Value call a method of your dll. It should look something like this:
=MyDllName.ClassName.MyMethodOrSubOrWhatever
This is a great article that can walk you through this:
Assuming you already have a .dll - Place your dll in the report designer folder (where your RDL is) and the report server folder, somewhere around here:
Program Files\Microsoft Visual Studio 8\Common7\IDE\PrivateAssemblies
Program Files\Microsoft SQL Server\MSSQL.3\Reporting Services\ReportServer\bin
Now add a reference to your dll from your report.
With your report open go to Report, Report Properties, References, Add reference, browse to your dll and add it.
Now in a text box properties Value call a method of your dll. It should look something like this:
=MyDllName.ClassName.MyMethodOrSubOrWhatever
This is a great article that can walk you through this: http://support.microsoft.com/kb/920769
P.S. Another option, if you don't want the web server doing the heavy lifting, is to use stored procedures. However, in our experience with very large database systems, it is much easier to scale up the web servers than it is to scale up the database servers so we do much of the heavy lifting on the web servers.
If you need a data set that is generated by custom .NET code, you can either set up a web service (here's a good tutorial), or you can set up a custom "data processing extension".
A data processing extension will allow you to choose a new data source in the SSRS report designer, and this data source will run custom .NET code. The full description is on MSDN, but here are the basic steps:
Create a new class library project
Implement all of the required extensions (and any desired optional ones)
Copy the DLL to the SSRS bin folder
Edit the SSRS config file to register your extension (by specifying the fully qualified name of your IDbConnection class)
You can find working examples from both CodePlex and Microsoft.

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.
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.
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.
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.
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

Using a shared data source for dynamically generated and deployed reports

I'm dynamically generating RDL files for SSRS 2008, assembling my reports from "building blocks" which I defined as reports on Report Server, and which I use as subreports on my generated report.
On my Report Server, I have a single, shared data source which does work as long as I run stuff directly on the report server.
What I'm trying to accomplish is this:
my generated main report should reference that shared data source
my subreports contained on the generated main report should also use the same data source
after I deploy the report to report server using the webservice interface, I'd like to be able to actually see the report right away
For now, I can generate and validate my RDL just fine, I can deploy it to the report server just fine, too - it shows up and all, great.
But when I try to view the report, I get an error that my data source is invalid or has been removed or something.......
What am I missing?? I am pretty sure I have the right data source - GUID for it and all - and the names do match. How do I tell a generated RDL to use the shared data source already present on the server??
Answering my own question here, hoping someone else might find this useful:
I was under the (false) impression that the unique "DataSourceID" given to a data source on the server would be sufficient to identify it uniquely.
So in my generated RDL, I had something like :
<DataSources>
<DataSource Name="MyDataSource">
<Transaction>true</Transaction>
<DataSourceReference>MyDataSource</DataSourceReference>
<rd:DataSourceID>6ba7c588-e270-4de9-988c-d2af024f10e1</rd:DataSourceID>
<rd:SecurityType>None</rd:SecurityType>
</DataSource>
</DataSources>
Now this worked once, when my data source was indeed called "MyDataSource" and located in the same directory as my report which I published through the RS WebService API.
As soon as I moved the data source elsewhere, it stopped working.
THE SOLUTION:
This may sound silly, but I really didn't "get it" at first: the DataSourceReference needs to have the full and complete "path" on the Reporting Server to that data source I want to reference. Just specifying the unique ID won't do....
So once I changed my RDL to:
<DataSources>
<DataSource Name="MyDataSource">
<Transaction>true</Transaction>
<DataSourceReference>/MyProject/DataSources/MyDataSource</DataSourceReference>
<rd:DataSourceID>6ba7c588-e270-4de9-988c-d2af024f10e1</rd:DataSourceID>
<rd:SecurityType>None</rd:SecurityType>
</DataSource>
</DataSources>
(notice the <DataSourceReference>/MyProject/DataSources/MyDataSource</DataSourceReference>)
since that moment it works like a charm.
Hope someone might find this useful some day!