Solved

How to Know which Cell Value was Clicked

Posted on 2014-04-16
2
378 Views
Last Modified: 2014-04-17
How to Know which Cell Value was Clicked

In a SQL report that displays a table control, how can I determine which cell in a table was clicked by the user?

Image a simple SQL report called MainReport that has one parameter and one tablix control.  It is a 2-column table control, where the first column will list the names of backup jobs, and the second column will list the time that each job was completed. When you browse to MainReport, you enter a parameter date, such as today’s date (e.g. 04/16/2014), and click [View Report]. The table within the report will then display all of the backup jobs that ran on that date, similar to the following:

 Backup Job | Time Completed
============|================
 X-Job      |       12:14 AM
 Y-Job      |        3:02 AM
 Z-Job      |        8:46 AM
 Z-Job      |        6:05 PM

I have the Action property of the cell under the Time Completed column set to Go To Report. Therefore, when you click on a time value, you are redirected to a report called DetailsReport. For example, when you clicked on 8:46 AM, you are redirected to the DetailsReport, and the report will list file names, file types, file sizes, etc. of each file that was backed up by Z-Job on 04/16/2014 @ 8:46 AM. Using the Go To Report action is easy to do, because this action allows you to select which dataset columns should be used to filter the DetailsReport.

The users, however, do not like the fact that when you click a value under the Time Completed column, it displays the DetailsReport in the same browser window. What they want is to have a new browser window appear (or a new tab) that displays the DetailsReport, and to have the original browser window continue displaying the MainReport.

I can change the Action property and have it Go To URL, instead of Go To Report, and have the URL open DetailsReport in a new browser window. I can even pass the date parameter within the URL. But what I can’t figure out is how to determine which time value was clicked. Along with the date, it is also important to know which time value was clicked in order to properly filter the DetailsReport.

Does anyone know how to do this?

Thank you,
0
Comment
Question by:brian_appliedcpu
2 Comments
 
LVL 65

Accepted Solution

by:
Jim Horn earned 500 total points
ID: 40005333
>how can I determine which cell in a table was clicked by the user?
In any expression, you'll be able to reference the value in any field in the row clicked with
Fields!the_column_name_goes_here.Value

Open in new window

If you mean the field specifically, then I'd just add the field name to the expression.

btw you can also pass parameters in the Action 'GoToURL'
Parameters!parameter_name_goes_here.Value

Open in new window

0
 
LVL 2

Author Closing Comment

by:brian_appliedcpu
ID: 40006839
I already am using a reference to Fields!TimeComplete.Value, but it is not properly filtering the DetailsReport. Not only does the report include the details that I want, but it includes details that are outside the time specified.

The table control is based on a dataset containing 2 SQL Server tables, combined by an Inner Join. It joins the primary key of the parent table to the foreign key in the details table. So every detail that occurred at say 8:46 PM has the same foreign key value. So what I did was to add the foreign key column to the query Select statement and then in report, change my reference to Fields!ForeignKey.Value, instead of TimeComplete. Now the DetailsReport filters properly.
0

Featured Post

Highfive + Dolby Voice = No More Audio Complaints!

Poor audio quality is one of the top reasons people don’t use video conferencing. Get the crispest, clearest audio powered by Dolby Voice in every meeting. Highfive and Dolby Voice deliver the best video conferencing and audio experience for every meeting and every room.

Join & Write a Comment

Suggested Solutions

Written by Valentino Vranken. A while ago I wrote an article called Chart Optimization Tips (http://www.experts-exchange.com/articles/Microsoft/Development/MS-SQL-Server/MS-SQL_Reporting/Chart-Optimization-Tips.html).  This article explained how …
Introduction As you'll probably know, a data region in a SQL Server Reporting Services report can be linked to only one dataset.  This makes it troublesome when you need to display data from more than one dataset in the same data region.  SQL Serve…
Sending a Secure fax is easy with eFax Corporate (http://www.enterprise.efax.com). First, Just open a new email message.  In the To field, type your recipient's fax number @efaxsend.com. You can even send a secure international fax — just include t…
In this seventh video of the Xpdf series, we discuss and demonstrate the PDFfonts utility, which lists all the fonts used in a PDF file. It does this via a command line interface, making it suitable for use in programs, scripts, batch files — any pl…

708 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

Need Help in Real-Time?

Connect with top rated Experts

9 Experts available now in Live!

Get 1:1 Help Now