Paul Turley's SQL Server BI Blog

sharing my experiences with the Microsoft data platform, SQL Server BI, Data Modeling, SSAS Design, Power Pivot, Power BI, SSRS Advanced Design, Power BI, Dashboards & Visualization since 2009

Menu

Skip to content
  • Home
  • My Books
  • Video Tutorials
  • Presentations
  • Training & Consulting Services
  • Visualizations
  • About/Bio
  • Paul’s Bio
  • Note to SPAMers

Monthly Archives: June 2009

Drill-through Report Link Breadcrumbs

June 27, 2009 by Paul Turley

2

If you have created multiple drill-through reports, you know that the report navigation works in one direction and that some users struggle to find the best method to navigate back to a previous report. The report toolbar contains navigation controls including a Back button for the previous report in a chain of linked reports but many users don’t find this intuitive. A common user experience paradigm in many well-designed web applications places a series of hyperlinks at the top of a page indicating both the path that brought the user to the page they’re viewing and a path for navigating back to any page along that path. This is a breadcrumb trail of hyperlinks. Reporting Service provides a means to navigate to any other report deployed to the server but it does not have any type of HTML report item that would allow you to build a series of embedded hyperlinks or anchor tags.

This technique shows you how to build a series of breadcrumb hyperlinks that will allow your users to see where they’ve been and to navigate back to any report along the trail.

Product Versions

  • Reporting Services 2000
  • Reporting Services 2005
  • Reporting Services 2008

*The example used in this recipe is based on SSRS 2008 but this technique will work in earlier versions.

What You’ll Need

  • Series of reports with report navigation actions
  • Report parameter used to track the breadcrumb trail
  • Custom code function to build an ad-hoc query
  • Dataset used to provide the breadcrumb data
  • Matrix data region containing textbox report actions

Figure XX-1 shows an example of a breadcrumb trail in the report header of a detail report. Note the progressive drill-through path of reports the user opened en route to the current report.

fgXX01

Figure XX-1

In the production implementation of this technique, report actions could be implemented using any of the compatible report items, including textboxes, images, a grouped table, matrix, list or chart data points as the report action source object. The purpose of this recipe is to demonstrate the breadcrumb technique and not the complexities of embedded report actions. As such, we will be using a simple textbox on the report body to navigate between sample reports. These reports will not have any data sources or datasets other than the one required for this technique.

Designing the Report

In the end, you will have four almost identical reports designed to demonstrate the technique. You will start by designing one report with the base functionality for all reports and then create three copies of this report, rename them and make the necessary modifications.

1. Create a new report named Breadcrumb Report 1.

2. Drag and drop the report name from the Built-in Fields to create a title textbox and style the report header as you typically would with a large, bold font, horizontal line, etc, as you see in Figure 1.

3. In the report body, about an inch or three centimeters below the line, add a textbox to use as the report action source object. The user will click this text to navigate to the next report. Add some appropriate text to this textbox to indicate that it’s a link to the second report.

In a more sophisticate production report, this textbox would be replaced with other report items or data regions with appropriate report actions.

fgXX02

Figure XX-2

A report parameter is used to pass the report navigation history to the target report. With each new report in the navigation chain, the name of that target report will be added to a comma-separated string passed in the parameter. This parameter will only be used internally and not shown to the user.

4. Add a report parameter named CallingReports.

5. Set the parameter to accept a Null value and set the visibility to be Hidden.

fgXX03

Figure XX-3

A dataset query will be used to drive a matrix data region to contain the report links. This query will be built using an expression and custom code function. Before we put this part into place, we must create a static query to generate the metadata for the dataset. This dataset will not actually consume any real data but a dataset must have a valid data source, And of course a data source must have a valid connection string to satisfy this requirement.

6. Create a new dataset and name it LinksQuery.

7. Any valid shared or embedded data source may be used for this dataset because data will not actually be read from a database. Create or select a data source and select any local or remote server and any valid database. I’ve used the localhost server and the Master database in this example.

8. For the query, type:

SELECT Null As Link

This is only a temporary placeholder to generate a field object named Link. The actual query string will be generated in a custom code function and expression.

fgXX04

Figure XX-4

A Matrix will be used to display each of the report links, each separated by a right angle bracket, >. Only the column header cells will be used in the Matrix.

9. Add a matrix data region to header area of the report body.

10. Drag the Link field to the Column Groups list to create a new group and group header.

11. Add a new column to the right, inside the group.

12.

13. Right-click in the header cell for this column and add the following expression:

=IIF(Fields!Link.Value = Last(Fields!Link.Value, “LinksQuery”), “”, “>”)

14. Choose both of these cells and set the Color to Blue.

15. Set the text in the first cell to be underscored to make it look like a hyperlink.Compare the matrix shown in Figure XX-5 to validate your design

fgXX05

Figure XX-5

16. Select the entire matrix and remove all borders using the toolbar or ribbon.

17. Resize the second row containing the data cells to reclaim this unused vertical space. Reduce the height of this row to make it as small as possible.

18. Add a textbox to body of the report.

19. Right-click and choose Textbox Properties.

20. On the Actions tab, create a report action by choosing the radio button Go to report.

21. The destination report doesn’t exist yet so you will just type this value into the drop-down list. Type Breadcrumbs Report 2 into the Specify a report property.

22. Click the Add button to add a new target report parameter. If this report has previously been created, this parameter would be available for selection. Type CallingReports in the Name column.

23. Click the expression button (fx) next to the Value column and type the following into the Expression window:

=IIF(IsNothing(Parameters!CallingReports.Value), Globals!ReportName, Parameters!CallingReports.Value & “, ” & Globals!ReportName)

24. Close and save the Expression dialog and use Figure XX-6 to verify these settings.

fgXX06

Figure XX-6

25. Click OK to save these settings and close the Text Box Properties dialog.

26. Edit the report properties and add the following code to the Code window:

Function ListToLinksSQL(List As String) As String

    Dim sTargetReport() As String

    Dim sReport As String

    Dim sOut As String

    sTargetReport = Split(List, “, “)

    For Each sReport In sTargetReport

       If sOut <> “” Then sOut &= ” UNION “

       sOut &= “SELECT ‘” & sReport & “‘ AS Link”

    Next

    Return sOut

End Function

27. Edit the dataset properties.

28. Replace the query command text with the following expression:

=Code.ListToLinksSQL(Parameters!CallingReports.Value)

29. Save and close the report.

30. Create three copies of the Breadcrumbs Report 1, named:

Breadcrumbs Report 2
Breadcrumbs Report 3
Breadcrumbs Report 4

If you are using BIDS, the easiest way to add copies of a report to the project is to select the first report in the Solution Explorer and then use Ctrl-C and Ctrl-V to copy and paste a new file, then rename it. In Report Builder 2.0, use the Save As? feature to save copies of the file to the same folder as the original.

31. Modify each reports so that the report action targets the next report in the sequence and the last report back to the first.

The Breadcrumbs Report 2 report action should navigate to Breadcrumbs Report 3. Breadcrumbs Report 3 should navigate to Breadcrumbs Report 4, and Breadcrumbs Report 4 should navigate back to Breadcrumbs Report 1.

Preview the first report and click the link to navigate to the second report. Continue to follow the links on each subsequent report and note the accumulated breadcrumb links in the report header. Click any of the links to navigate to any of the reports in the series.

fgxx07- arrows

Figure XX-7

Several variations are possible.  This technique will display one link per distinct report.  If the user were to navigate from Report 1 to Report 2 and then back to Report 1,  A link for Report 1 would be displayed only once.  Adding another parameter to capture the current date and time for each drill-through would provide a mechanism to group on each duplicate report and to sort the list in the order of navigation.

Breadcrumbs Reports examples.zip (8.90 kb)

Share this:

  • Click to email this to a friend (Opens in new window)
  • Click to print (Opens in new window)
  • Click to share on Twitter (Opens in new window)
  • Click to share on LinkedIn (Opens in new window)
  • Click to share on Facebook (Opens in new window)
  • Click to share on Reddit (Opens in new window)

Like this:

Like Loading...
Posted in SQL Syndication, SSRS Design. Tagged Breakcrumb links, Drill-through, Report navigation

Post navigation

Credentials

930,374 total unique views.  Recent views:

Enter your email address to subscribe to this blog and receive notifications of new posts by email.

Join 4,001 other followers

Recent Posts

  • A Conversation with Ásgeir Gunnarsson about Power BI in the Enterprise
  • Setting up Power BI project Team Collaboration & Version Control
  • Next Level Power BI – M Language Basics
  • Chat with Donald Farmer at PASS Summit 2019
  • Next Level Power BI – SVG Databars
  • Next Level Power BI – SVG Symbols
  • So, I wrote a bedtime book now?!
  • Power Platform World Tour Vancouver Presentations
  • Power BI Project Good and Best Practices
  • Power BI Product Suggestion: Show Measure Dependencies

BI Industry BI Projects Business Analytics Microsoft BI Platform MVP Community PASS Power BI PowerPivot Power View Self-service BI SolidQ SQL Server SQLServerPedia SQL Server Pro Magazine SQL Syndication SSAS Administration SSAS Design SSRS Administration SSRS Design Tabular Models

Archives

  • December 2019 (1)
  • November 2019 (5)
  • October 2019 (1)
  • September 2019 (1)
  • August 2019 (2)
  • July 2019 (5)
  • May 2019 (1)
  • April 2019 (3)
  • March 2019 (1)
  • February 2019 (2)
  • December 2018 (3)
  • November 2018 (1)
  • October 2018 (1)
  • September 2018 (3)
  • July 2018 (5)
  • May 2018 (2)
  • April 2018 (2)
  • March 2018 (3)
  • February 2018 (3)
  • January 2018 (3)
  • December 2017 (3)
  • November 2017 (4)
  • October 2017 (1)
  • September 2017 (2)
  • August 2017 (1)
  • July 2017 (1)
  • June 2017 (4)
  • April 2017 (8)
  • March 2017 (1)
  • February 2017 (2)
  • January 2017 (8)
  • December 2016 (4)
  • November 2016 (3)
  • October 2016 (2)
  • September 2016 (1)
  • July 2016 (3)
  • June 2016 (3)
  • May 2016 (3)
  • March 2016 (6)
  • February 2016 (5)
  • January 2016 (2)
  • December 2015 (4)
  • November 2015 (3)
  • October 2015 (2)
  • September 2015 (2)
  • August 2015 (3)
  • July 2015 (6)
  • June 2015 (1)
  • May 2015 (5)
  • April 2015 (4)
  • March 2015 (1)
  • February 2015 (2)
  • January 2015 (4)
  • December 2014 (3)
  • November 2014 (1)
  • October 2014 (4)
  • September 2014 (1)
  • August 2014 (2)
  • July 2014 (5)
  • June 2014 (4)
  • May 2014 (2)
  • April 2014 (6)
  • March 2014 (3)
  • February 2014 (7)
  • January 2014 (5)
  • December 2013 (2)
  • November 2013 (1)
  • October 2013 (1)
  • September 2013 (2)
  • July 2013 (4)
  • June 2013 (5)
  • April 2013 (1)
  • March 2013 (4)
  • February 2013 (3)
  • January 2013 (1)
  • December 2012 (4)
  • November 2012 (4)
  • October 2012 (3)
  • September 2012 (3)
  • August 2012 (2)
  • July 2012 (2)
  • June 2012 (2)
  • May 2012 (3)
  • March 2012 (2)
  • February 2012 (3)
  • December 2011 (1)
  • November 2011 (3)
  • October 2011 (11)
  • September 2011 (7)
  • August 2011 (4)
  • July 2011 (2)
  • June 2011 (4)
  • May 2011 (5)
  • April 2011 (5)
  • March 2011 (4)
  • February 2011 (2)
  • January 2011 (4)
  • December 2010 (4)
  • November 2010 (4)
  • October 2010 (1)
  • September 2010 (1)
  • August 2010 (2)
  • June 2010 (1)
  • May 2010 (2)
  • April 2010 (1)
  • March 2010 (19)
  • December 2009 (1)
  • June 2009 (1)

Tag Cloud

Ad-hoc reporting Add columns Alternate row colors best practices BI Center of Excellence BI Conference Bill Gates Breakcrumb links Browser settings Business scorecard Checkbox in report Checkbox list Check mark Column chart Conditional formatting Conference presentation Conference review Conference session Datazen Date parameters DAX Drill-down Drill-through Dynamic column visibility European PASS Filter by user Greenbar report Hide columns KPI indicator Login prompt Manually starting subscription Master-detail report MDX datasets MDX queries Microsoft Architecture Journal Microsoft MVP Nested tables Parameterize Parameters PASS Conference PASS Summit PASS Summit 2017 Pop-up window; Java script Portland OR PowerPivot Power View Recipes Remove columns Repeating list report dependencies Report deployment Report navigation Report parameters Report recipe book Reports for MDX Return specific row Self-service reporting SolidQ SolidQ Journal SQL Saturday SQL Server community SQL Server MVP SSRS dynamic columns SSRS version control Start subscription Strip line Subscription Tabular report design TechEd Threshold line Top values User-related report content User authentication User prompted to login Wrox book
RSS
RSS Feed
Blog at WordPress.com.
loading Cancel
Post was not sent - check your email addresses!
Email check failed, please try again
Sorry, your blog cannot share posts by email.
%d bloggers like this: