How to Pass DB Connection string as parameter in SSRS through URL - reporting-services

Our application is in .net and we are required to embedd and show case the SSRS reports from the .net application. Embedding was succesfull, now the data source is required to be made dynamic based on the logged in user, there respective server IP, DB name, user name and password is supposed to be passed to the SSRS. How can we achieve this?
Would really appreciate any help.
Thanks
Trying to get the connection string as a parameter from the URL but we are not sure how to accept the parameter. where should we get the control from

Assuming you can get the datasource passed to the report as a string already, then you can do this, but you must use an embedded datasource, not a shared datasource.
When designing reports from scratch you'll need to set the datasource's connection string as normal, just so field lists etc. all work, then once you have the report working, edit the datasource and hit the [fx] button next to the connection string.
Then just select your passed in parameter like below where myConnectionString is the passed in parameter.

Related

Error when trying to pass a value to a parameter via a URL in SSRS

I have a report in SSRS that has a drill-down report. I would like to have the action linking to the drill-down report open it in a new page.
I've used this expression as the action URL:
="javascript:void(window.open('server?ItemPath=%2fTimisoara%2fDrilldown%2fDrill01&ID=123', '_blank'))"
When trying to access the drill-down report I get the following error:
The ID parameter is missing value
You're not constructing your URL properly. For starters the server bit should actually be the name of the server (or the IP address) and you need to properly construct the URL including the http://
You can then construct your URL like so:
http://reportserver/ReportServer?/Path/To/Report/DrillDownReport&Param1=Value1&Param2=Value2
I recommend reading the following MSDN pages:
URL Access (SSRS)
Pass a Report Parameter Within a URL

SSRS Report - Dynamic Connection String and Parameters

I am building a SSRS report portal to run various reports. One of the requirement is to pass the database connection string (server name, database, username and password) dynamically to the report.
Please let me know how to achieve this. I am new to SSRS report.
Thanks
Sri
You should make sure that your datasource is embedded in the report.
And you can set your Connection string dynamically using an expression.
There is some more information on dynamically setting connection strings Here
You can use parametr and experssion for connection string of datasource
="Data Source=Server;User ID=sa;Password=sa;Initial Catalog="+Parameters!Database.Value

Use existing parameters for Transfer SQL Server Objects Task (Initial Catalog missing?)

I'm setting up a Transfer SQL Server Objects Task and can't seem to specify existing Connection Managers for it. When parametrizing the Connection Managers it creates, there isn't an Initial Catalog parameter. My package is defined only for server/db/user/password parameters. How can I feed this thing a connection string without making it a parameter of the package? Make a sub-package and pass it a connection? Is there a better way? Maybe use a variable for the connection string parameter somehow?

SSRS DateTime Parameter in URL

I am passing the following URL in order to load a report in SSRS. There are two parameters in the report:
http://servername/Reports/Pages/Report.aspx?ItemPath=%2fReports%2fApplications%2fPersonnel%2fRptNameChange&ssn=#########&txtEffectiveDate=06/01/2012
Parameters
String - ssn
DateTime - txtEffectiveDate
However, when the page loads, it is as if the parameters are not recognized and it loads the page with empty fields in the parameters.
What is missing or incorrect about the URL? Thanks!
You're so close! You should be able to pull this off by changing Report.aspx to ReportViewer.aspx. For example, see below:
http://servername/Pages/**ReportViewer.aspx?**ItemPath=%2fReports%2fApplications%2fPersonnel%2fRptNameChange&ssn=#########&txtEffectiveDate=06/01/2012
I was calling the Report Manager URL, instead of the Web Service URL.
Here was the working version of the SSRS Url:
http://servername/ReportServer?/Folder1/Folder2/Folder3/
In order to complete the call to the SSRS Web Service Url, attach the report name and any parameters that are needed to run the report:
http://servername/ReportServer?/Folder1/Folder2/Folder3/ReportName&Param1=12345

excel vba to CRUD drupal nodes

We need to periodically migrate Excel reports data into Drupal nodes. We looked at replicating some Excel functionality in Drupal with slickgrid, but it wasn't up to snuff. The Excel reports people don't want to double-enter their data, but their data is important to be in this Drupal site.
They have hundreds of Excel reports, and update a row in each weekly. We want a button at the row end to fire a VBA macro that submits the data to Drupal, where a new node is created from the info submitted. (Yes, we are experienced with both Drupal and VBA; all users and the site are behind our firewall.) We need the new node's nid or URL returned so we can then create a link in Excel directly to that node
Site is D6, using Services 3.x module. I tried the REST server module, but we can't get it to retrieve data without session authentication on, which we can't do from Excel. (unless you can?) I also noticed the 'data' it was returning via browser url was 14 or 20 nodes' info, not the one nid requested (Example: http://mysite.com/services/rest/report/node/30161)
When I attempt to create a simple node like this from VBA:
Dim MyURL as String
MyURL = "http://mysite.com/services/rest/report/node?node[type]=test&node[title]=testing123&node[field_test_one][0][value]=123"
Set objHTTP = CreateObject("MSXML2.ServerXMLHTTP")
With objHTTP
.Open "GET", MyURL, False
.setRequestHeader "Content-Type", "application/x-www-form-urlencoded"
.send (MyURL)
End With
I get HTTP Status: Unauthorized: Access denied for user 0 "anonymous"
and HTTP Response: null
Everything I search for has examples in php or java, nothing in VBA. Also tried switching to using an XMLRPC server but that's even more confusing. We would like json (used application/json, set formatter accordingly in REST server settings), but will use anything that works.
Ideas? Thanks in advance!
EDIT: I changed POST to GET in the .Open, and tried the different request headers (json, xml, etc.) I still get 14 nodes of basic node data returned, not my single node I requested. I guess this proves my REST server is working at the URL I specified, but I still don't know how to POST a node to Drupal from Excel.
Another Edit: GET and DELETE are working, just not POST or PUT !?! As anon user in browser, I can paste into address bar the 'http://mysite.com/node/add/test' as normal, it prompts me for just the title, and I can anonymously create it with no problem. Submitted via Excel results in the 'Unauthorized: Access denied for user 0 "anonymous"' error. So I can view and delete but cannot create? I double-checked my perms are set correctly.
I have always found that error messages actually mean what they say.
HTTP Status: Unauthorized: Access denied for user 0 "anonymous"
Looks like your web server is expecting some sort of login and authentication which the VBA script does not/cannot provide.
Instead of using CRUD, can you push the data directly to the database, bypassing any REST interaction? I move a lot of data between spreadsheets and a Drupal site, and have a few VBA modules that help me easily interact with the Drupal database schema. These are for Drupal 8.
VBA-SQL-Library
VBA-Drupal-Library
The first library allows users to create SQL queries without having to do a bunch of string concatenation, more in line with the Drupal SQL objects. The second allows a person to configure a VBA object like a Drupal Entity, and insert and look up those entities in Drupal's database.