Click here to monitor SSC
SQLServerCentral is supported by Redgate
Log in  ::  Register  ::  Not logged in
Home       Members    Calendar    Who's On

Add to briefcase

Deleting record from SSRS report Expand / Collapse
Posted Monday, April 29, 2013 2:04 AM



Group: General Forum Members
Last Login: Wednesday, November 9, 2016 10:50 PM
Points: 144, Visits: 603
I have a table with multiple records in SSRS. For each of these records the first column has checkboxes, for each record.
I was wondering if there is a possibility of deleting multiple records by selecting chexkboxes and doing Apply. This deletion should happen from Database also.

Any thoughts/suggestions ?
Post #1447396
Posted Monday, April 29, 2013 8:03 AM


Group: General Forum Members
Last Login: Saturday, September 17, 2016 8:01 AM
Points: 2,834, Visits: 2,629
There is no checkbox control in SSRS so I think you might have to rethink that part of it.

Allowing a user to delete records through a report can be a dangerous situation. I would be concerned that the lack of control and oversight to the process might cause some mistakes, and possibly data corruption issues.

That said, yes, you can use SSRS to delete a record, one record at a time, from a table style report. There are a few things I would do in order to get this working.
-First I would build a logging table to put the data that is deleted to allow for some possibility of easy recovery
-Second, on the table based report with all of your records where you want to pick some to delete I would put a report action to a "Delete" report that passes parameters.
-Third the Delete report would be based on a stored procedure that took the appropriate key values (passed via the report action above) from the selected record on the table report, put the record into the log table, deleted it from the source table and then add an output query to the stored procedure to return something to confirm the deletion to the actual report. Something like
SELECT 'The record with a key of ' + @KeyValue + ' has been successfully deleted' AS RecordDeleted
-Fourth I would take the RecordDeleted value from the stored procedure and display it in the Delete report.
Post #1447548
« Prev Topic | Next Topic »

Add to briefcase

Permissions Expand / Collapse