Reputation: 10247
In a BIDS project, after selecting Reports > Add New Report, and adding a connection string as the Shared Data Source in the Report Wizard, the wizard next prompts for a query (in the "Design the Query" page of the wizard).
I want to specify an existing Stored Procedure. How can I do that? Is it possible to specify it directly in the connection string? e.g, I provided something like this as the connection string:
SERVER=GoCards2016;DATABASE=platypusdata;UID=duckbill;PWD=dannyAndTheJuniors;Connection Timeout=0
Can I also insert the Stored Procedure to use in there somewhere?
Or do I need to enter a bogus query in the "Design the Query" page of the wizard and later replace it in the .rdl (xml) file with the Stored Procedure name? Or...???
Upvotes: 3
Views: 3708
Reputation: 5157
Upvotes: 1
Reputation: 14108
The Report Wizard will let you only use Query strings so you can't select a stored procedure, but You can use the EXEC
statement to specify a stored procedure to run.
exec my_stored_procedure_name
Upvotes: 2
Reputation: 10247
Click through the wizard, then, in the "Data" tab, change the Command Type from Text to Stored Procedure and enter the name of your Stored Procedure.
So, with a little more specific instructions:
In the “Design the Query” page of the wizard, either enter “Exec [sp name]” or just enter some temporary query such as “select * from [tableName]” and then, once the Report Wizard has completed, in the data tab of the report, change the “Command type:” dropdown from Text to “Stored Procedure” and then enter the name of the Stored Procedure below.
Mash the “!” (Run) button to generate the data.
Upvotes: 3