Sample Header Ad - 728x90

Executing a SQL Stored procedure from a SSRS text box item - Is it possible

0 votes
1 answer
2231 views
I know the we can use custom code in SSRS and I know you have actions on Textbox items in a SSRS report. Is it possible to "combine" this functionality for the following, which I appreciate is quite out the normal use of SSRS I wish to produce a list of outstanding requisitions for purchase orders from the SQL tables of our ERP system. In the report against each item would be a Text box with the word "Approve" in The idea is for the requisitions the user wishes to approve they would click on the "Approve" and then use the custom code would fire a SQL procedure, passing in the id of the requisition to the procedure. This procedure would interact with the ERP system to do the approval. Is this possible? Some pseudo code for the SSRS report code Imports System.data.sqlclient Dim connectionString AS String = "Server=XXXXXXX;Database=db1234;User Id=user_name;Password=my_password" Dim Command As New SQLCommand("[CHC_AppBuilder].[Testssrscall]", connectionString) Command.CommandType = CommandType.StoredProcedure Command.ExecuteNonQuery() The SQL procedure [CHC_AppBuilder].[Testssrscall] just currently executes dbmail to myself Problems so far: 1. Location of the System.data.sqlclient.dll to add the references as per you would in visual studio, so far not been able to test the code. 2. Trigger the Stored procedure per item.
Asked by Ian W (249 rep)
Jul 18, 2018, 12:22 PM
Last activity: Nov 10, 2020, 10:50 AM