Link to home
Start Free TrialLog in
Avatar of scvens
scvens

asked on

On click action in SSRS 2005

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
Avatar of SQL_SERVER_DBA
SQL_SERVER_DBA
Flag of United States of America image

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.

example:
http://www.yukonxml.com/chapters/apress/reportingservices/dotnet/
Avatar of scvens
scvens

ASKER

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.
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
ASKER CERTIFIED SOLUTION
Avatar of PFrog
PFrog
Flag of United Kingdom of Great Britain and Northern Ireland image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of scvens

ASKER

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.
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...