Use web.config to configure default Report Server - configuration

I'm developing an app that will manage users' access to various SSRS reports. Most of the report will exist on a default Report Server, but we want to allow for growth to other Report Servers.
Access is controlled by a SQL Server 2008 R2 db, which includes the Report Path. Currently, if the report path begins with "/", we use the localhost/reportserver. Otherwise, if the path begins with "http://", I parse out the remoter reportserver and report path.
What I want to do is configure the default report server in web.config (it won't, of course, be localhost). But, I'm unable to find anything that will help me do this.
Any ideas will be most graciously accepted.
Thanks in advance,
Michell

Would an environment variable work for that? Set it in the webconfig and retrieve in your code. Seems too simple, so maybe I'm missing something.

Related

Change connection string of datasource on build for SSRS Project

I have a few SSRS projects and when I publish the projects, I have to manually go back to Reporting Services and change back the connection string to the correct server.
Is there a way to automate this? Can I change the connection string on build (before publish) base on my configuration?
I have to assume a few things here..
Your Report has a Datasource called something like Datasource_dev
You are attempting to deploy to different environments that have different datasources like Datasource_test and Datasource_Prod?
If the above conditions are true, then you simply have to set the correct datasource once on each of the servers you are deploying to ie, the first time you deploy the report.
You will also need to set the setting below (in properties of your SSRS project) to
OverwriteDataSources=false
Then all subsequent deployments will retain the datasource that was set manually.
Couple of things to Note.
Make sure you change the setting for all configurations you have (debug,release etc)
If you ever delete the report from the server, you'll have to reset the datasource again
Not sure if there's a way to fully automate it. But did you try to just create a Data source? Then just edit the Data Source connection of the report under Manage? In that way you don't have to go back to SSRS when you will just edit the connection of the report.

SSRS Looking for Non Existent Shared Dataset

What could cause one user to be initiating an old version of the report?
I have a report that runs perfectly when logged directly on the reporting services server.
When run from the LAN it gives an error that one of the parameter data sets execution failed. The error message shows that the parameter is pointing to a data set that was used in the report months ago but is no longer currently used. Looking at the properties of the report in reporting services everything is pointed to a valid shared data set.
The .rdl file has a connection string saved in it. This is what you connect to during development and it is the default connection. When you upload the file to the reporting services server, you have the option of overriding that and pointing it to a shared data source. In other words, the "old" data source has always been built into that .rdl file (you can look at the XML to confirm this), but it is being overridden on the server.
Hope this helps clear up the confusion.

How to import SSRS shared datasets and data sources directly into BIDS 2008?

Using:
SSRS Report Server 10.50.1600.1
BIDS Visual Studio 9.0.30729.4462 (from remote client on same domain and network; not local on SSRS server)
I'd like to be able to add existing shared data sources and shared datasets that live on my report server to my BIDS project on my local workstation.
I know I can create a shared resource from a BIDS instance, and deploy it to the SSRS server. I can also do the same via Report Builder 3.0; deploy or publish from either application, then navigate to the report server URL (https://SSRSServer.mydomain.com/reportserver), download the resource(s) to my machine, add them as a Shared resource, and then redeploy as appropriate...but that's a bit convoluted.
What I'd like to do is add a shared data source (or set) in BIDS the same way that I can in Report Builder 3.0. In RB, I can navigate to the report server URL (using WebDAV, I'm assuming), and pick the rsds file I need, however, from BIDS, I'm only able to browse UNC and local paths (URL+DAVWWWRoot doesn't work, and neither does manually adding a data connection string).
I feel like I'm overlooking something obvious, but I can't find anything on the subject, and I've been racking my brain for too long this morning...
In short: is there anyway to browse my report server resources from BIDS 2008, in the same fashion as Report Builder 3.0 with the intention of adding existing datasets and data sources (please see screenshots for reference)?
Image taken from adding a shared data source from Report Builder 3.0
I'm sad to tell you but there is not.
You only can save those objects ,local by downloading them and then adding to the project explicitly.
I checked if there is a way to paste multiple datasets/datasources into your project file but it is also not possible, looks like it is encrypted in the state string of the project file.

How can I add an embedded data source to RDL in C# code?

I am trying to use SSRS in a multi-tenant situation. The base version we want to support is SQL Server 2008 but if R2 is needed we might be ok with that.
I am currently using the ReportingService2005.asmx endpoint which seems to expose the ReportService2005SoapClient class (even though all samples seem to show ReportingService2005 class).
When we run a report I want to make a copy of that report from the server, add an embedded datasource, point the datasets to that datasource and then run the report.
I have gotten as far as:
getting the RDL from the server
modifying the XML to add the DataSource
pointing the datasets to point to the new datasource
...but when I try to "CreateReport" I get the following error:
System.Web.Services.Protocols.SoapException: The dataset ‘DataSet1’ refers to the data source “mydatasource_LOCAL”, which does not exist.
at Microsoft.ReportingServices.Library.ReportingService2005Impl.ExecuteBatch(Guid batchId)
at Microsoft.ReportingServices.WebServer.ReportingService2005.ExecuteBatch()
I have added the dataset to the RDL, it looks the same as when I add one in the designer. However, I assume something needs to be added to the server? What am I missing?
(As an aside, I know MS Dynamics enabled multi-tennant SSRS in a single instance, but I see no info on how they did it. If they have any code or anything they share someone could point me to that would be awesome.)
You're using the correct endpoint, more or less. From MSDN:
The ReportService2005 and ReportService2006 endpoints are deprecated in SQL Server 2008 R2. The ReportService2010 endpoint includes the functionalities of both endpoints and contains additional management features.
In any case, you mention you modify the RDL to use a new data source in step 2. I might be wrong, but I think you probably still need to add a DataSource item to your report catalog using the ReportingService2010 CreateDataSource(...) method.
If you deploy a new report from Visual Studio to report server it wil also mention in the log that it's deploying the data source before it deploys the report.
Of course you could also create that data source on the server beforehand, using the report manager (though "mydatasource_LOCAL" may not be an ideal name).

Consume SSRS Report within Windows Service

I want to consume a SSRS report within a windows service (wrote in C#). The service will then export the report as a PDF and write it to disk.
Is this even possible? I am new to SSRS.
Interesting question Mick. We have done code where we can call the SSRS report and export it as PDF but that code is in DLL. Now windows service is no different I would advise you to go through the following code http://sandeep-aparajit.blogspot.co.uk/2010/02/how-to-execute-and-save-ssrs-report.html and try the same. It should work as far as i can see the only problem you might come across might be Code access security but it is worth a try. Thanks for the question you have given me an idea.
The URL for Reporting services will depend on what version of SSRS you are using but as you can see you can easily spot and change it http:///reportserver/reportservice2005.asmx instead of 2005 you might have to change to 2008 or something.