[Okta Webinar] Learn how to a build a cloud-first strategyRegister Now


On click action in SSRS 2005

Posted on 2007-10-08
Medium Priority
Last Modified: 2012-06-27
Hi i am working on a report in SSRS 2005. i have a image in that report. Is it possible that i click that image and the background color of that perticular box changes(That image is placed on a rectangle). So that i know  that perticular image in that perticular row has been selected. Is this possible in SSRS? Please let me know if the question is not  clear
Question by:scvens
  • 3
  • 2
LVL 16

Expert Comment

ID: 20034221
The question is clear, I would write a custom code routine to handle this, Custom code for use within your report using code embedded in the report.


Author Comment

ID: 20034393
Thanks  for replying. As this is on click action i was  not very sure if this could be possible.And i am new to SSRS and this is a bit complex code to write is there any way that u could help me  a bit more to finish my task.
LVL 18

Expert Comment

ID: 20034508
The only method I can think of to do this without reloading the report would be to put a javascript:void() function as the URL destination on the navigation properties of the image.
The problem with this is that you need an ID of the report object to do anything with it, and SSRS doesn't assign an ID to report objects. You can force it to assign an ID by making the control toggle the visibility of another control, but I can't even get it to work with this ID (not to mention the fact that you don't know the ID at design time)

So, assuming that we can't do it using javascript, the only other way of doing it is to re-run the report every time you click on anything.
i.e. add a hidden parameter to the report (SelectedID)
When you first run the report, this will be null.
Set the background color of the rectangle to an expression
   =IIF(Fields!ID.Value = Parameters!SelectedID.Value, "Red", "White")
and the navigation of the image to point back to this same report, with the appropriate ID in the SelectedID parameter.

Then, when you click something, the report will reload with that item highlighted in red.
You can expand this to cope with multiple selections by making the parameter multi value.

Hope this is some help
Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

LVL 18

Accepted Solution

PFrog earned 2000 total points
ID: 20034528
I'm not sure if custom code can handle this - you would need some way of executing the custom code from the onclick - which I don't think you can do unless you rerun the report, in which case you don't need custom code as parameters will do it on their own.

I'd be interested to be proven wrong about calling custom code from clicks - it would be a useful feature if it were possible...

Author Comment

ID: 20034810
Thanks for  replying this question alex.Actually the   main point here is i want to change the background color without refreshing the  report. Any w ay i appriciate the help alex and i am accepting this solution. I am also posting another question lpease have a look at it.
LVL 18

Expert Comment

ID: 20034958
I won't post in the new question as I don't know of a solution to the problem - as far as I'm aware there is no solution without refreshing... sorry...

Featured Post

Microsoft Certification Exam 74-409

Veeam® is happy to provide the Microsoft community with a study guide prepared by MVP and MCT, Orin Thomas. This guide will take you through each of the exam objectives, helping you to prepare for and pass the examination.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Why is this different from all of the other step by step guides?  Because I make a living as a DBA and not as a writer and I lived through this experience. Defining the name: When I talk to people they say different names on this subject stuff l…
Windocks is an independent port of Docker's open source to Windows.   This article introduces the use of SQL Server in containers, with integrated support of SQL Server database cloning.
Via a live example, show how to set up a backup for SQL Server using a Maintenance Plan and how to schedule the job into SQL Server Agent.
Viewers will learn how to use the SELECT statement in SQL to return specific rows and columns, with various degrees of sorting and limits in place.
Suggested Courses

834 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question