"Any ideas?" is the most frequently-asked question in technical forums. My answer is: yes.

Walkthrough: When groups behave, they're groovy. Multilinks!

When I wrote, a few months ago, that group bands are a real PITA, I didn't mean to imply that you should never use them.

Recently we had a requirement for a list of items that should each be linked to a different request to an external application.  As you know, and if you don't you can read this other recent post, SSRS has lots of ways to provide linkage and jumps to external content.  The question, this time, was how to put multiple links in one cell.

I'm going to leave RS 2008's placeholder control out of this discussion.  Obviously, if you can fashion the HTML in another application and just dump it all in one field, you can use a placeholder control to display whatever HTML, including multiple links, you need.  But it's not always so easy, especially when the items to be linked occur in separate rows in the first place.  That's the scenario we're considering here.

0. Sample data for this walkthrough 

I've used the MySQL World tutorial database as well as NorthWind, occasionally, to illustrate this particular point to VFP folks, because you can always find some way to fashion a link from geographic data, for example:

"" + city

... but I'm getting a little bored with it and our needs for this walkthrough are really simple.  So I've chosen an example that's a little closer to home, in fact it's downright self-referential:

SELECT 'Dynamic Page Breaks in SSRS: Going to Eleven' Label,
           '' Link , 
           'March' CMonth
'Coming back into the light',
           '' , 
'Whitespace occasionally can jump',
'Buddha''s dream',

... that's all you'll need to follow here.

1. Consider the base case

The normal way to provide a link is to use the "Navigate" or "action" facility on an RDL display object, such as a textbox.

In this case, we'll have a textbox with the expression Fields!Label.Value in it, and we'll link to the expression Fields!Link.Value.  That seems simple enough.

Here's the equally simple-minded result. I'm going to cut and paste the output right out the MHTML export rather than using a screenshot, just for fun, so you can click on the links.  (The other shots in this post are regular images, but I've used the underline style for the links so you can recognize them easily):

MultiLinks - LSN Recent Posts


simple table








Dynamic Page Breaks in SSRS: Going to Eleven





Coming back into the light


Whitespace occasionally can jump


Buddha's dream


2. Nest one data region inside another

The trick to having some elements repeat multiple times against another, in an RDL, is simply to nest data regions. 

In the following example, I've put a List inside another list. A list will repeat once for each relevant row of data, and it can contain free-form content by, in turn, containing other RDL display elements, such as text boxes and images.  In this case I've used the inner list to create a "bulleted list" of links. I've used a different color for the bullet just to make sure you can see the distinct textbox elements within the single list container. 

The outer list is distinguished from the inner content because it repeats on a different basis (in this case, I've grouped the posts by month, using the expression =Fields!CMonth.Value). 

The outer list must be grouped. But, as the note on the report surface says, you can use containers to group report display elements to make them easier to move as a unit.  If you don't happen to need a grouping value, just group the outer container on a constant.

3. Now build a better table

So now you can take that inner list container that we used above, and put it right into a cell of a (group) row of a table.  The result gives us exactly what we're looking for in the table, without any fancy or finicky HTML-generation code to bring together the multiple data rows.


See how easy that was? It was almost fun. And we owe it all to group expressions.

Poor, dear little group expressions. So terribly misunderstood.

They don't want to be evil.   

Comments (12) -

  • club penguin

    6/17/2009 12:55:25 PM |

    Thank You very much! Now it works. I wish, I had found this document a few hours earlier.

  • Horst Dusseldorf

    6/24/2009 11:55:09 PM |

    Multi links makes the greats to your site. Thanks for posting this suitable and important post.

  • Wills

    7/12/2009 10:11:30 PM |

    I am trying to run reports but it sometimes gets me bugs, learned a lot from this blog.

  • otimização de sites

    10/31/2009 4:52:11 AM |

    It´s really easy!
    Not fun, but really easy and that was a amazing tutorial!
    Thanks for helping me.

  • hosted crm

    11/16/2009 2:13:45 AM |

    Nice post I Like your site very well and continue to do so. I have bookmarked your site.

  • gladiator shoes

    12/12/2009 6:05:48 AM |

    What do you mean in the phrases "if you can fashion the HTML" and "fashion a link". What's the meaning of the word fashion on that??

  • >L<

    12/12/2009 8:00:21 AM |

    fashion as a verb = "make", create.

    In French, the verb *to make* looks like this in present tense: Je fais, tu fais, il fait, nous faisons, vous faites, ils font.

  • fap turbo scam

    12/16/2009 1:17:34 AM |

    Thanks for the Sample data for this walk-through. That helps me in the assignments in Software Engineering Module.

  • fxg 2010

    9/9/2010 7:35:59 PM |

    Not just conceptual but useful on the ground.

  • moveis decoração

    12/3/2011 12:24:07 PM |

    Excellent work.I very much appreciated your writings and sharing your thoughts to everyone.Thanks.

Comments are closed