SSRS can be also used for user inputs!

Jason YousefSr. BI  Developer
There's the plan, then there's what actually happens.
A recent question popped up and the discussion heated up regarding updating a COMMENTS (TXT) field in a table using SSRS.

Of course it’s not the best way to use SSRS as it’s a presentation layer and so limited in doing that using Parameters and sub-Reports which will fire a code or a stored procedure to update or delete a record…but IT COULD BE DONE!!

And that’s what I was bargaining about…

1-I started by creating a new project in VS 2008, “Report Server Project” type.
2-I’m using SQL 2008 R2 as my testing platform…I’ve created a test DB called “Admin”


3-I created a test table called “Employees”  contains only 3 columns.

Create TABLE Employees
    ID int IDENTITY (1,1),
    Name varchar(50),
    Comments varchar(MAX)

4- Inserted 4 test records…
Insert Employees VALUES('Jason', 'Lazy Employee')
    ,('Yousef', NULL)
    ,('John', 'Anything Goes')
    ,('Smith', NULL)

5-back to VS, Created a Shared Data Source to my Admin DB

6-created 3 Blank reports, using the shared Data Source.

1-      To display the records which in the table.
2-      A user summary and confirm screen of which record will be updated and with what.
3-      A done screen, which will call a stored procedure or just have a simple inline T-SQL query.


That’s the trick in the second report, you need to hide the ID and keep the Comments Parameter visible and allow it to accept NULL Value, so it display the record before you need to enter the value.  And also if you need an empty comment, such as to clear the comments field or whatever.

7-The design…

Report1: 1ReportsToDB.rdl

Just a basic table, drag the 3 fields to the table, added an extra field with an expression of  =CHR(0254) and Font of: Wingdings  Just to display a shape without using an image.
Please refer to my article for shapes in


Also I added an action to that text field to go to report 2 and pass the ID.

Report2: 2ReportsToDB-Confirm.rdl

Again a simple table with the basic 3 fields and added another field for the new Comments value which is using an expression of:  =Parameters!Comments.Value and a field for a confirmation symbol, yes again using my favorite shapes font WINGDINGS , with action to run the 3rd report and pass the ID and the new comments.

Report3: 3ReportsToDB-Done.rdl

I added 3 text fields, but it’s all optional (for fun).
Just with an action to go back to the first report and the summary or what was done!!

Lets’ run and test it….

I’ll click next to my name on the check mark to update my comments…
That’s what you get at first because we allowed the NULL, that’s the trick to see the table before the parameter gets initialized.
Remove the NULL check mark and enter the new comments….
You’ll get the confirmation above…
Now click on the check mark to confirm the change,  yes you guessed it right…it’s the wingdings shapes again ¿
And that’s what you get..
I’ll click on my GO Back, to the first report to check the data.
Done.. my record was updated in the DB.
Again that’s for the purpose of showing that SSRS is more than a presentation layer and that was the simplest part, it could get more complicated and done more professionally using Custom .NET code and functions.
Hope that helps someone…

The project can be downloaded from


Jason Yousef
Jason YousefSr. BI  Developer
There's the plan, then there's what actually happens.

Comments (15)

Alpesh PatelSolution Architect at TCS (SAFe®Agilist, TOGAF® Foundation, PSM I®, MCP, MCSD)

New to learn (Out of window)
I've tried adapting this to a report we have where we want to allow people to put comments in but I am getting an error on the last page, the confirmation page:
An error occurred during local report processing.
An error has occurred during report processing.
Query execution failed for dataset 'InsertComment'.
Must declare the scalar variable "@ClientID".

My insert query is
                      (CommentId, ClientID, CommentDate, Comments, Author)
VALUES     (REPLACE(CONVERT(VARCHAR(12), GETDATE(), 114), ':', ''),@ClientID, GETDATE(),@Comments, REPLACE(SYSTEM_USER, '<domain>\', ''))

Open in new window

I'm using the date for the primary key because I messed up the table and can't get it to auto-assign the PK.  I have to add a ClientID parameter to the first page of the report or the parameter does not show up on the second page, very annoying this is.  

Any help you can give to resolve this issue would be greatly appreciated.
Best article ever! I enjoyed doing this task :)
can you do the same for SSRS 2010?
How do you do it in SSRS 2010

View More

Have a question about something in this article? You can receive help directly from the article author. Sign up for a free trial to get started.