Report model data - sql-server-2008

I'm working on ssrs 2008 r2 and from it, I'm building a report model using a relational database as a source.
I have many databases and all of them have the sames structure (same tables and same table fields).
from the first look on report model,all entities are generated from the data source view. Consequently, it doesn't allow for one report model to be used with multiple database.
Is there anyway to use the same report model for multiple databases ?
Ps: my report model has so many entities, for each one, I have to edit it.so you can see that what I need is to automate the process.

I was keen to see answers for this question since I have this same requirements for product I've inherited. But since you've not had any other answers perhaps this will help if I describe the setup we have.
Initial Deployment
Locally we have one Visual Studio 2008 (BIDS) Report Model project which contains one data source, and a number of data source views and reporting models. Each time a new database goes online, we change the connection string of the data source and update the deployment configuration of the project to target a different report server folder following the format /Models/<databaseName>. The model is then deployed using BIDS. The frequency of this is low, only happening once every couple of months. If we had to setup for lots database all at the same time this would be a slow and painful process. As a side note we limit access to each deployed model by configuring the security of each reporting folder i.e. the <databaseName> folder.
Model Updates
Since our initial deployment is manual, updating the model in the same way would be very painful. So I wrote a tool which makes use of the web services provided by SSRS to refresh our deployed models. At a high level this how this works; after changes are made to the report model found in BIDS project (remember we only have one project and not one for each deployed model) the tool loops for each database and calls the SetModelDefinition web service method passing in our updated model file. We're not changing the data source so the updated models on the report server will continue to use its configured data source. Again this only works because the data source name isn't changed per database.
For reference here's example C# code of what the tool does to bulk upload the model
// prepare the model for upload
string pathToSmdlFile = "c:\ReportModel.smdl";
string pathToDataSourceViewFile = "c:\ReportModel.dsv";
string semanticModel = System.IO.File.ReadAllText(pathToSmdlFile);
string dataSourceView = System.IO.File.ReadAllText(pathToDataSourceViewFile);
// combine the semanticModel and dataSourceView, BIDS does when you use the `deploy` action
// because we're doing this in code we have to combine
byte[] model = Encoding.UTF8.GetBytes(semanticModel.Replace("</SemanticModel>", dataSourceView + "\n</SemanticModel>"));
// upload model using web service
using (var rs = new ReportingService2005WS.ReportingService2005())
{
rs.Url = "http://yourserver/ReportServer/ReportService2005.asmx";
rs.Credentials = new System.Net.NetworkCredential("admin", "password");
foreach (string databaseName in GetDatabaseNames())
{
string fullpath = string.Format("/Models/{0}/ReportModel", databaseName);
rs.SetModelDefinition(fullpath, model);
}
}
I'm not saying this is the perfect setup - I actually think I should be possible to upload the reporting model once and have something change the data source at the point that the report is used. Perhaps its possible to configure the use of different data sources depending on the SSRS login used. Failing that the report itself should somehow pass the details of the correct data source to use (or connection string). On the flip side this does mean that our users don't have to know the details of the connection to the database. We just give them SSRS logins and allow them to build with report builder; because of the security applied to each database folder they are restricted to there database...

Related

Pentaho Reporting without Datasource

I am possible to create a report without datasource connection?
for example,
I have a link with JSON return and in pentaho report.
I'mnot using datasource connection like JDBC/ODBC/JNDI, just hit an URL then the URL will return JSON data, this data will show up in detail section.
am i possible?
i tried to search something in google, but i still have no idea.
I am using Pentaho Report Designer 5.3.0.0, i tried to ask in pentaho forums too.. but theres no answer for me :(
You can do this in two ways:
 
Creating a CDA with the result of the web service (link json), this is passed to the pentaho report designer by clicking on the tab data, right click data sets, and then Community Data Acces, there are settings and you choose the CDA that you created previously
You can create a transformation with the pdi, from the transformation you can easily consume the web service, and treat the data, then pass this as datasource of the report designer

Can't subscribe to ReportBuilder report in SSRS 2008-r2

When a user tries to subscribe to a report created via ReportBuilder they receive the following error: "Subscriptions cannot be created because the credentials used to run the report are not stored, or if a linked report, the link is no longer valid."
As far as I can tell the credentials ARE being stored, but report server seems to be ignoring them. We are able to subscribe to non-ReportBuilder reports using the same data source just fine.
We have been trying to track down the problem for several weeks now and haven't gotten anywhere. Any help would be greatly appreciated.
The report uses a shared data source on its model. This is the only model defined on the server:
The model uses the following data source defined on the server (this is the same data source that other reports use, and it's the only data source stored on the server.):
The Data Source is set to store the credentials on the report server (you can see the results of testing the connection at the bottom of the screenshot):
You cannot subscribe to a Report Builder report that uses a model as a data source if the model contains model item security settings. Could this be the cause of your issue?

Create a shared datasource in VS2012 for SSRS

I'm just looking to create a shared datasource in VS2012 without selecting an entire database scheme. We'll mostly put doing all the dataset queries by sql query.
I found this but i'm still unable to create a shared datasource.
http://msdn.microsoft.com/en-us/library/ms159165.aspx
For an embedded data source, verify that Embedded connection is selected. Does not exists.
So how do you create a shared datasource in VS2012 with just a connection string?
A DataSource is just a connection string in an element in an xml structure as far as SSRS is concerned. A shared one is just one kept as it's own object and then the rdl elements(reports) have a reference in their xml to that object. Think of an rds file (data source for SSRS) as this very similar to .NET standard connection strings:
Data Source=(server);Initial Catalog=(database)
Plus you can store credentials to mock who is running the report. Thus you can make a proxy user to run the database connection. However SSRS does this through a GUI called 'Business Intelligence Development Studio' it is an add on to Visual Studio that is generally SQL Server version matches that VS version EXCEPT FOR 2012. That one creates a shell Visual Studio of VS 2010 just meant for BIDS.
To my knowledge you should be creating these directly in BIDS and not try to hack the RDS file directly unless you get the ReportService2010.asmx web service to mess with it's properties in .NET (which is a lot more work.).
To add one you just do this:
Go into BIDS with a report project
Expand a project
Right Click 'Shared Data Sources'> 'Add New'
Click 'Edit...' next to connection string
You get a menu very similar to ADO.NET standard connection string creator
Put in ServerName
Put in DatabaseName
8*** Optional put in default credentials.
Click OK
Generally SSRS has three parts to everything it does
Datasource = connection string (rds file when not embedded)
Dataset = select query or proc results or other data source return (rsd file when not embedded)
Report = resultant xml display of elements such as parameters, tables, matrices, etc. (RDL file when working on hosted report)
Generally reports can have everything embedded or else just reference everything they use. References are often easier for deployments sake as SSRS is designed to look if DataSources first exist and NOT OVERWRITE them by default. Thus if you reuse a datasource it is much easier in the long run as long as policy for it is set up correct.
If you want to just know the structure of an rds file they look like this:
<?xml version="1.0" encoding="utf-8"?>
<RptDataSource xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" Name="Test">
<ConnectionProperties>
<Extension>SQL</Extension>
<ConnectString>Data Source=TestServer;Initial Catalog=TestDatabase</ConnectString>
</ConnectionProperties>
<DataSourceID>45be0ac1-80a8-4d5c-906b-c13b03298e0a</DataSourceID>
</RptDataSource>

Reporting Services Expression-based Connection Strings can't have any data driven parameters

I need my reports to have dynamic connections strings. We have multiple database servers and catalogs and only want to maintain a single Report file. The only solution I could find that would let me do this programmatically was "Expression-based Connection Strings". Basically I programmatically pass in parameter values to the report for the ServerName and InitialCatalog.
This works for simple reports. Although not ideal as modifying the report requires changing the connection to a hardcoded connection string and then switch back to the expression-based one when I want to save and publish.
HOWEVER, this does not work for reports that have data-driven parameters. For example I have a report that filters data based on a "City" parameter that the user selects when they first open the report. The City parameter is feed data from a query. It seems that I can't just set the connection parameters and let reporting services query for the City parameter.
I'm open to ideas here other than "Expression-based connection strings".
Thanks.
I had the same problem. The solution was surprisingly simple - just move your "ServerName" and "InitialCatalog" to the top of parameter list.
A possible option is to create a deployment script(which uses rs.exe) and deploy multiple versions of the report. In the deployment script you can update the datasource of the report. Your source control would still only have one report and each time you released it you run the script to update the multiple copies you have in production.

textboxes in Datarepeater dynamically 'databound'

I need to know if it is possible to dynamically bind a textbox residing within a datarepeater to a 'dynamically' created BindingSource. I am using VB.net. The database I am using is a MySQL database.
I have to use the connection dynamically due to the fact that the database my not permanently reside on the same server.
[edit]
ok, so it seams that I am a dolt when asking questions. The app that I am making is not web based. it is a simple (I hope) app that connects to a MySQL database, accesses a table so I can edit/view it. Current setup is using the Add DataSource wizard. I have successfully connected to the dbase dynamically using the mysql connector dll but without the textboxes set at design time to a datasource, I am unsure on how to 'link' them via the datarepeater.
Your connection string should be defined in your Web.Config, and if you move your database to a different server, it's just a matter of modifying the web.config entry. As long as you keep the connection string name the same, the BindingSource object will pick up the new value from the config.edit
In truth, the same concept should apply here as it does in the web app answer listed above.
All of your data objects should be hard-coded, and it's just the connection string (which you'll have to either ask the user for, or push out as update when the DB moves) which will get modified.
For example, create a App.Config file in your project. Have one of your configuration values be the connection string. This config value will be where you go to get the connection string whenever you need it. Then your wizard will be there to allow users to easily modify the connection.
then look in app.config
the conenction string should be there.
If it is not then you should put it in here as you can change this file at any time and not have to recompile your app.