Avatar of rhservan
rhservan
Flag for United States of America asked on

Can SSRS perform a database write back based on specific criteria in the report output?

How can I perform an "Update database" action based on specific report output?
.NET ProgrammingSSRS

Avatar of undefined
Last Comment
itcouple

8/22/2022 - Mon
Chris Luttrell

Probably but what are you trying to do?  The first basic tenant of a reportng subsystem is not to modify the data.
rhservan

ASKER
1. This is an environment to test 10,000 transactions a day.
2. If the datasource provides incorrect data to the report I need to flag it and send an update with the correct
information.
3. On the larger scale this will also provide debug information to the originating input to the datasource and permanently correct the problem.
Ashok_Paulose

I do not think you can do any CRUD operations thru SSRS even if you are executing a stored procedure that provides the data for you report.  A simple alternate would be to run two reports:  One for the correct data and the other for incorrect data.
Experts Exchange has (a) saved my job multiple times, (b) saved me hours, days, and even weeks of work, and often (c) makes me look like a superhero! This place is MAGIC!
Walt Forbes
rhservan

ASKER
Ashok,
Two reports?  I will already have the one report with the incorrect data, but unless I am able to "write back to the data source I will not have correct data for the correct data report.  PLease advise.
Ashok_Paulose

What exactly do you mean by correct data?  Do you have a business rule that is violated in your SQL or in the report that you want to report as incorrect?  You cannot write back to the datasource when using SSRS.
rhservan

ASKER
Through some additonal research, although a little vague for me, but it appears the statement below can perform the update.

 based on a  parameter then I could then I could have a conditional update statement

Please advise.
⚡ FREE TRIAL OFFER
Try out a week of full access for free.
Find out why thousands trust the EE community with their toughest problems.
Ashok_Paulose

I think there is a block in the SSRS to prevent any sort of transaction that modifies data.

I may not have understood your specific issue, but in general you can use the reports to identify the incorrect data and may be suggest a fix for the incorrect data, but the reports itself cannot make changes to the source data.
rhservan

ASKER
Ashok,
Thanks for your responses. To clarify and simplify:
1. I have a datasource used in my report.
2. The datasource has provided incorrect data.
3. I flag the error(s) in the report based on conditions not met.
For an example - If data is Less than 100 then okay else error.

My research has shown me that there are two solutions as shown below:

1. you can use parameters to prompt a user for input and, if a user has the necessary permissions in the database, parameters can be passed to an INSERT query expression to insert a new record.

2. Jump to url and aspx page

IIt is not clear to me how to create either of the above.  
ASKER CERTIFIED SOLUTION
itcouple

THIS SOLUTION ONLY AVAILABLE TO MEMBERS.
View this solution by signing up for a free trial.
Members can start a 7-Day free trial and enjoy unlimited access to the platform.
See Pricing Options
Start Free Trial
GET A PERSONALIZED SOLUTION
Ask your own question & get feedback from real experts
Find out why thousands trust the EE community with their toughest problems.
rhservan

ASKER
itcouple, it has been crazy lately, but I am beginning to work on this problem again.  I want to test your ideas above soon.  Does javascript run by default in SSRS? Any additional info at this point would be great.  I will be working on this over the weekend. Thanks for your efforts.
This is the best money I have ever spent. I cannot not tell you how many times these folks have saved my bacon. I learn so much from the contributors.
rwheeler23
itcouple

Hi

Javascript is not really supported but you can embed some javascript in SSRS. If you use ReportViewer you can also 'grab' html code and run your javascript. I did that in the past to get nice tool tips ;)

Regards
Emil