[Last Call] Learn how to a build a cloud-first strategyRegister Now

x
?
Solved

How to create a dynamic DataSource

Posted on 2013-01-08
7
Medium Priority
?
259 Views
Last Modified: 2013-01-14
Hi Experts,
I am trying to figure out how to use a dynamic data source in my report file? I use 2 different databases which are on the current server. But I want a variable to drive my data source so that on my query I don't have to mention the name of the database. Your help will be highly appreciated
0
Comment
Question by:Josh2442
7 Comments
 
LVL 25

Expert Comment

by:TempDBA
ID: 38757691
Ask user to input the servername, databasename and create the data source using the parameters dynamically.
http://stackoverflow.com/questions/2101456/using-dynamic-connection-strings-in-ssrs2008
0
 
LVL 37

Accepted Solution

by:
ValentinoV earned 915 total points
ID: 38757935
If you use an embedded data source, you'll have the famous fx button on the Data Source Properties window which can then be used to create an expression such as:

="Data Source=YourServer\YourInstance;Initial Catalog=" & Parameters!YourDatabase.Value

Open in new window

The expression assumes that a parameter called YourDatabase of type Text exists, and contains a valid name of a database on the YourServer\YourInstance server.

Please note that the fx button is only available for embedded sources, not shared ones...

And also note that you may want to build your datasets first, prior to making the data source dynamic.  This will avoid some annoying popups...
0
 
LVL 21

Expert Comment

by:Alpesh Patel
ID: 38758062
In First Data Source get the Database names.

Create Parameter for that Database name.


Create Second datasource in that you Database name as parameter.


Hope you do the way.
0
Free Tool: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

 
LVL 37

Expert Comment

by:ValentinoV
ID: 38771910
Josh2442, would you mind explaining the B grade?
0
 

Author Comment

by:Josh2442
ID: 38771941
I have done the above steps. So far it looks good but still has been giving errors for
My first dataset where I have had my dynamic datasource. I will have to see further on that issue but your post was helpful for me to set these up. I wish I could change the grade to A but it is too late. Thanks ValentinoV.
0
 
LVL 37

Expert Comment

by:ValentinoV
ID: 38773639
Thank you Josh2442 for responding, I appreciate that.

If you think the error is directly related to the dynamic data source, please go ahead and click the Request Attention link (the yellow warning sign located under your question) to have the question re-opened.  You're welcome to interact with the experts, with that I mean if something isn't clear or you need some additional information to get something done 100%, you're free to post additional follow-up comments in the same question thread.  In fact, the experts appreciate that more than a question that gets closed with a less than A grade.

If you think the error is not directly related to the dynamic data source and thus not to this question, don't hesitate to open a new one.  I'm sure someone will be glad to help you out :)
0
 

Author Comment

by:Josh2442
ID: 38774126
Thanks ValentinoV. I too am thankful for your expert opinions not only in this question but my previous questions as well. I will also keep the above listed comments by you in mind before jumping into conclusion and grading it right away from now on. Thankyou once again
0

Featured Post

Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Hi, I have heard from my friends that it’s not possible to create Label Printing report using SSRS. I am amazed after hearing this words not possible in SSRS. I googled lot and found that it is possible to some of people know about the Report Bui…
It is helpful to note: This is a cosmetic update and is not required, but should help your reports look better for your boss.  This issue has manifested itself in SSRS version 3.0 is where I have seen this behavior in.  And this behavior is only see…
Exchange organizations may use the Journaling Agent of the Transport Service to archive messages going through Exchange. However, if the Transport Service is integrated with some email content management application (such as an anti-spam), the admin…
Screencast - Getting to Know the Pipeline
Suggested Courses
Course of the Month17 days, 15 hours left to enroll

830 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question