join the MSSQLTips community

Today's Site Sponsor


 

Find performance issues related to Analysis Services memory limits.
 


Displaying Reporting Services drill-through reports in new browser window
Written By: Rob Fisch -- 7/11/2007 -- 2 comments -- printer friendly -- become a member



Make time for your professional development

        Win SQL Books  -----  SharePoint Tips  -----  Live Webcast - SQL Backup Mistakes  -----  Bookmark and Share        

Problem
When using the standard Reporting Services drill-through navigation the new report is rendered in the current browser window, therefore overlaying the original report. There is no built in way to indicate you want the drill-through report to open a new window. In a standard web browser you can use the (shift-click) functionality to open the link in a new window, but in Reporting Services this functionality is disabled.  So how can you launch a new window when you open a drill-through report?

Solution
Use a little javascript with a customized URL in the "Jump to URL" option of the Navigation tab.

Non-parameterized Solution
To get started, let's pop up a simple non parameterized report. Follow these instructions:

  1. Instead of using the "Jump to Report" option on the Navigation tab, use the "Jump to URL" option.
  2. Open the expression screen (Fx button).
  3. Enter the following:
    --------------------------------------------------------------------------------
    ="javascript:void(window.open('http://servername?%2freportserver%2fpathto%2freport&rs:Command=Render'))"
    --------------------------------------------------------------------------------
  4. Click OK twice, then save and deploy the report.

Note: The link will not work from the designer environment. You must deploy the report (hopefully to a test area) to try the link.

See screenshots below.

That's the easy part, ready for a more dynamic approach?

Parameterized Solution
Now, let's say you want to pass a variable to the drill through report. Let's also assume you have a field called ProductCode. Normally, you might hard code that like this:

http://servername/reportserver?%2fpathto%2freport&rs:Command=Render&ProductCode=123

In this case, you want to pass variables dynamically, using an available value from the source dataset.

You can think of it like this:

http://servername/reportserver?%2fpathto%2freport&rs:Command=Render&ProductCode=Fields!ProductCode.Value

The exact syntax in the "Jump to URL" (Fx) expression window will be:

--------------------------------------------------------------------------------
="javascript:void(window.open('http://servername/reportserver?%2fpathto%2freport&rs:Command=Render&ProductCode="+Fields!ProductCode.Value+"'))"
--------------------------------------------------------------------------------

Note - To avoid confusion between double and single quotes, double quotes are in red above.

Notice, that the static portion of the URL is delimited within double quotes.

Next Steps

  • Next time you build drill-through report capabilities look at using this method to open a new browser instead of overlaying the original report
  • Look at your existing reports to see if this method makes more sense for your report navigation
  • Stay tuned for other Reporting Services tips from this author
Readers Who Read This Tip Also Read Comment or Ask Questions About This Tip Twitter This Tip!


Sponsor Information
Free SQL Server performance monitoring dashboard – Idera SQL check

Try SQL Object Level Recovery Native from Red Gate to save time and disk space. Download a free trial.

What you don't know could be your biggest asset! Innovative SQL Server Consultants.

Stop here to prepare for your next SQL Server interview!

Top 10 SQL Server Backup Mistakes and How to Avoid Them web cast - February 10, 2010

Make the most of MSSQLTips...Sign-up for the newsletter

Do you love this site and wish there was a SharePoint version?

Free whitepaper - Managing Complex Database Changes


 

 

DB Nitro - SQL Nitro

SQL Nitro sits between SQL Server & its clients, optimizing the normally inefficient TDS protocol. Optimize TDS & compress the data up to 80%, reduce SQL bandwidth by 50%, & improve response times over 65%!

Download now!



More SQL Server Tools
SQL Backup

SQL compliance manager

SQL safe backup

SQL diagnostic manager

SQL Refactor




Copyright (c) 2006-2010 Edgewood Solutions, LLC All rights reserved
privacy statement | disclaimer | copyright | advertise | write for mssqltips | feedback | about
Some names and products listed are the registered trademarks of their respective owners.