Quantcast
Channel: Smart ERP Solutions - Microsoft BI
Viewing all articles
Browse latest Browse all 22

How to retrieve data from different sources using a parameter?

$
0
0
A user can retrieve a particular set of data fields from different data sources through a single report.
 
For example: User can fetch the same set of data fields from either development/production/test data source.
 
Below is the procedure to achieve the desired functionality:
 
Step 1: Create a parameter
 
After creating a report, you have to create a parameter which defines the label names for the connections. Below is the image you can refer to.
 

Specify the ‘Available Values’ for the connections in the parameter.

Step 2:  Changing the data source properties

Now you have to modify the data source properties, refer to the image below in order to navigate & include an expression in the data source properties by clicking on Function (“Fx”) button.

Step 3:Using the code
After clicking on the function button you can insert a piece of code to achieve the functionality.Below is the code & the image for the reference.

=IIF(Parameters!<ParameterName>.Value = "<LabelName>", "Data Source = <ServerName>; Initial Catalog =<DatabaseName>",IIF(Parameters! ParameterName.Value = "<LabelName>", "Data Source =<ServerName>; Initial Catalog = <DatabaseName>","Data Source = <ServerName>;Initial Catalog = <DatabaseName>"))

& ";User ID=<>;Password=<> "

Final Ojective Attained

So now when you click on a report parameter, a prompt will appear, here you have to select the source in order to see the particular details in the report from the particular source.

By: Prasad Davange

 


Viewing all articles
Browse latest Browse all 22

Trending Articles