<?xml version="1.0" encoding="UTF-8" ?>
<?xml-stylesheet type="text/xsl" href="http://blogs.adatis.co.uk/utility/FeedStylesheets/rss.xsl" media="screen"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" xmlns:wfw="http://wellformedweb.org/CommentAPI/"><channel><title>Philip Kibaki&amp;#39;s Blog</title><link>http://blogs.adatis.co.uk/blogs/philip/default.aspx</link><description /><dc:language>en</dc:language><generator>CommunityServer 2007 SP2 (Build: 20611.960)</generator><item><title>HTML Links Embedded within Text (SSRS 2008R2)</title><link>http://blogs.adatis.co.uk/blogs/philip/archive/2012/03/23/html-links-embedded-within-text-ssrs-2008r2.aspx</link><pubDate>Fri, 23 Mar 2012 16:59:47 GMT</pubDate><guid isPermaLink="false">8d7d37f8-4a66-4c95-9fba-293fa87607dc:10322</guid><dc:creator>PhilKibaki</dc:creator><slash:comments>0</slash:comments><wfw:commentRss xmlns:wfw="http://wellformedweb.org/CommentAPI/">http://blogs.adatis.co.uk/blogs/philip/rsscomments.aspx?PostID=10322</wfw:commentRss><comments>http://blogs.adatis.co.uk/blogs/philip/archive/2012/03/23/html-links-embedded-within-text-ssrs-2008r2.aspx#comments</comments><description>&lt;h1 style="line-height:16pt;margin:24pt 0cm 0pt;"&gt;&lt;font face="Cambria"&gt;&lt;font style="font-size:13pt;" color="#000000"&gt;Overview&lt;/font&gt;&lt;/font&gt;&lt;/h1&gt;  &lt;p style="line-height:13pt;margin:0cm 0cm 10pt;" class="MsoNormal"&gt;&lt;font face="Calibri"&gt;&lt;font style="font-size:11pt;"&gt;So, old news, from SSRS 2008 onwards, Reporting Services can render HTML Tags, although there are some limitations to the tags that can be used:&lt;/font&gt;&lt;/font&gt;&lt;/p&gt;  &lt;ul&gt;   &lt;li&gt;     &lt;div style="line-height:13pt;margin:0cm 0cm 10pt;" class="MsoNormal"&gt;&lt;font face="Calibri"&gt;&lt;font style="font-size:11pt;"&gt;Hyperlink tag:&lt;font color="#ff0000"&gt; &amp;lt;A href&amp;gt;&lt;/font&gt;&amp;#160;&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;   &lt;/li&gt;    &lt;li&gt;     &lt;div style="line-height:13pt;margin:0cm 0cm 10pt;" class="MsoNormal"&gt;&lt;font face="Calibri"&gt;&lt;font style="font-size:11pt;"&gt;Text formatting tags:&lt;font color="#ff0000"&gt; &amp;lt;S&amp;gt;,&amp;lt;B&amp;gt;, &amp;lt;I&amp;gt;, &amp;lt;U&amp;gt;&lt;/font&gt;&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;   &lt;/li&gt;    &lt;li&gt;     &lt;div style="line-height:13pt;margin:0cm 0cm 10pt;" class="MsoNormal"&gt;&lt;font face="Calibri"&gt;&lt;font style="font-size:11pt;"&gt;List handling tags:&lt;font color="#ff0000"&gt; &amp;lt;OL&amp;gt;, &amp;lt;LI&amp;gt;,&amp;lt;UL&amp;gt;&lt;/font&gt;&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;   &lt;/li&gt;    &lt;li&gt;     &lt;div style="line-height:13pt;margin:0cm 0cm 10pt;" class="MsoNormal"&gt;&lt;font face="Calibri"&gt;&lt;font style="font-size:11pt;"&gt;Font tag: &lt;font color="#ff0000"&gt;&amp;lt;FONT&amp;gt;&lt;/font&gt;&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;   &lt;/li&gt;    &lt;li&gt;     &lt;div style="line-height:13pt;margin:0cm 0cm 10pt;" class="MsoNormal"&gt;&lt;font face="Calibri"&gt;&lt;font style="font-size:11pt;"&gt;Header, style and block tags: &lt;font color="#ff0000"&gt;&amp;lt;SPAN&amp;gt;,&amp;lt;H{n}&amp;gt;,&amp;lt;LI&amp;gt;, &amp;lt;DIV&amp;gt;, &amp;lt;P&amp;gt;,&lt;span style="mso-spacerun:yes;"&gt;&amp;#160; &lt;/span&gt;&amp;lt;HN&amp;gt;&lt;/font&gt;&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;   &lt;/li&gt; &lt;/ul&gt;  &lt;p style="line-height:13pt;margin:0cm 0cm 10pt;" class="MsoNormal"&gt;&lt;font face="Calibri"&gt;&lt;font style="font-size:11pt;"&gt;I’ll be talking about using the hyperlink tags to drill through or link back to the same report within a lump of text return by a dataset.&lt;/font&gt;&lt;/font&gt;&lt;/p&gt;  &lt;p style="line-height:13pt;margin:0cm 0cm 10pt;tab-stops:92.15pt;" class="MsoNormal"&gt;&lt;font face="Calibri"&gt;&lt;font style="font-size:11pt;"&gt;Say your dataset returns some summary text that describes the data in the report, like “Sales for the Accessories Category amounted to £#,###.## putting it at around the 11th percentile” and you would like to drill through on the Keyword “&lt;u&gt;Category&lt;/u&gt;” only and not the whole text. &lt;/font&gt;&lt;/font&gt;&lt;/p&gt;  &lt;p style="line-height:13pt;margin:0cm 0cm 10pt;tab-stops:92.15pt;" class="MsoNormal"&gt;&lt;font face="Calibri"&gt;&lt;font style="font-size:11pt;"&gt;So you want&lt;/font&gt;&lt;/font&gt;&lt;/p&gt;  &lt;ul&gt;   &lt;li&gt;     &lt;div style="line-height:13pt;margin:0cm 0cm 10pt;tab-stops:92.15pt;" class="MsoNormal"&gt;&lt;span style="line-height:12pt;"&gt;&lt;font face="Calibri"&gt;&lt;font style="font-size:10pt;"&gt;Sales for the Accessories &lt;u&gt;&lt;span style="color:;"&gt;&lt;font color="#0033cc"&gt;Category&lt;/font&gt;&lt;/span&gt;&lt;/u&gt; amounted to £#,###.## putting it at around the 11th percentile&lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;/div&gt;   &lt;/li&gt; &lt;/ul&gt;  &lt;p style="line-height:13pt;margin:0cm 0cm 10pt;tab-stops:92.15pt;" class="MsoNormal"&gt;&lt;font face="Calibri"&gt;&lt;font style="font-size:11pt;"&gt;Instead of&lt;/font&gt;&lt;/font&gt;&lt;/p&gt;  &lt;ul&gt;   &lt;li&gt;     &lt;div style="line-height:13pt;margin:0cm 0cm 10pt;tab-stops:92.15pt;" class="MsoNormal"&gt;&lt;u&gt;&lt;span style="line-height:12pt;color:;"&gt;&lt;font face="Calibri"&gt;&lt;font style="font-size:10pt;" color="#0033cc"&gt;Sales for the Accessories Category amounted to £#,###.## putting it at around the 11th percentile&lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;/u&gt;&lt;/div&gt;   &lt;/li&gt; &lt;/ul&gt;  &lt;p style="line-height:13pt;margin:0cm 0cm 10pt;tab-stops:92.15pt;" class="MsoNormal"&gt;&lt;font face="Calibri"&gt;&lt;font style="font-size:11pt;"&gt;From a lump of text returned by a dataset.&lt;/font&gt;&lt;/font&gt;&lt;/p&gt;  &lt;h2 style="line-height:15pt;margin:10pt 0cm 0pt;"&gt;   &lt;br /&gt;&lt;font face="Cambria"&gt;&lt;font style="font-size:13pt;" color="#000000"&gt;Solution&lt;/font&gt;&lt;/font&gt;&lt;/h2&gt;  &lt;p style="line-height:15pt;margin:10pt 0cm 0pt;"&gt;&lt;font face="Calibri"&gt;&lt;font style="font-size:11pt;"&gt;We can handle this kind of request by generating the hyperlink to the report you would like to drill through in the dataset. This is as opposed to using textbox actions in the report. There are a number of advantages of handling this in the dataset&lt;/font&gt;&lt;/font&gt;&lt;/p&gt;  &lt;ul&gt;   &lt;li&gt;     &lt;div style="line-height:13pt;page-break-after:avoid;text-indent:-18pt;margin:0cm 0cm 10pt 36pt;mso-list:l0 level1 lfo3;tab-stops:92.15pt;" class="MsoListParagraph"&gt;&lt;font face="Calibri"&gt;&lt;font style="font-size:11pt;"&gt;Turn on the HTML markup type in the place holder properties for the &lt;i style="mso-bidi-font-style:normal;"&gt;Summary_Text&lt;/i&gt; Field.             &lt;br /&gt;&lt;/font&gt;&lt;/font&gt;        &lt;br /&gt;&lt;/div&gt;   &lt;/li&gt; &lt;/ul&gt; &lt;a href="http://blogs.adatis.co.uk/blogs/philip/image_144FDCAD.png"&gt;&lt;img style="background-image:none;border-right-width:0px;padding-left:0px;padding-right:0px;display:block;float:none;border-top-width:0px;border-bottom-width:0px;margin-left:auto;border-left-width:0px;margin-right:auto;padding-top:0px;" title="image" border="0" alt="image" src="http://blogs.adatis.co.uk/blogs/philip/image_thumb_7434CFEF.png" width="500" height="337" /&gt;&lt;/a&gt;   &lt;br /&gt;&lt;span style="mso-fareast-language:en-gb;mso-no-proof:yes;"&gt;&lt;/span&gt;  &lt;p style="margin:0cm 0cm 10pt;" class="MsoCaption" align="center"&gt;&lt;font face="Calibri"&gt;&lt;font style="font-size:9pt;" color="#4f81bd"&gt;&lt;strong&gt;HTML Markup Type Setting          &lt;br /&gt;&lt;/strong&gt;&lt;/font&gt;&lt;/font&gt;    &lt;br style="page-break-before:always;mso-special-character:line-break;" /&gt;&lt;/p&gt;  &lt;ul&gt;   &lt;li&gt;     &lt;div style="line-height:13pt;page-break-after:avoid;text-indent:-18pt;margin:0cm 0cm 0pt 36pt;mso-list:l0 level1 lfo3;tab-stops:92.15pt;" class="MsoListParagraphCxSpFirst"&gt;&lt;font face="Calibri"&gt;&lt;font style="font-size:11pt;"&gt;Now, you need to build the link to the report you are drilling to, this is best done in the report to keep it dynamic, therefore, deploying the report to a different server or folder won’t mean you have to change any code as you are going to use the global parameters available in SSRS.            &lt;br /&gt;            &lt;br /&gt;Create a hidden parameter that will hold the expression below. Alternatively, you can have this expression directly in the dataset parameter, just create a dataset parameter and in the value expression add this hyperlink expression.             &lt;br /&gt;            &lt;br /&gt;Pass this in to your dataset to complete it with the missing parameters; in this case Category Name is missing.&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;   &lt;/li&gt; &lt;/ul&gt;  &lt;p style="line-height:13pt;page-break-after:avoid;margin:0cm 0cm 10pt 36pt;tab-stops:92.15pt;" class="MsoListParagraphCxSpLast"&gt;&amp;#160;&lt;/p&gt;  &lt;p style="line-height:13pt;page-break-after:avoid;margin:0cm 0cm 10pt 36pt;tab-stops:92.15pt;" class="MsoListParagraphCxSpLast" align="center"&gt;&lt;a href="http://blogs.adatis.co.uk/blogs/philip/Blog2_3B1DF2ED.png"&gt;&lt;img style="background-image:none;border-right-width:0px;padding-left:0px;padding-right:0px;display:inline;border-top-width:0px;border-bottom-width:0px;border-left-width:0px;padding-top:0px;" title="Blog2" border="0" alt="Blog2" src="http://blogs.adatis.co.uk/blogs/philip/Blog2_thumb_690B45A5.png" width="506" height="226" /&gt;&lt;/a&gt;     &lt;br /&gt;&lt;/p&gt; &lt;span style="mso-fareast-language:en-gb;mso-no-proof:yes;"&gt;&lt;/span&gt;  &lt;p style="margin:0cm 0cm 10pt;" class="MsoCaption" align="center"&gt;&lt;font face="Calibri"&gt;&lt;font style="font-size:9pt;" color="#4f81bd"&gt;&lt;strong&gt;         &lt;br /&gt;HTML Link Expression           &lt;br /&gt;          &lt;br /&gt;&lt;/strong&gt;&lt;/font&gt;&lt;/font&gt;&lt;/p&gt;  &lt;p style="line-height:13pt;margin:0cm 0cm 0pt 36pt;tab-stops:92.15pt;" class="MsoListParagraphCxSpFirst" align="center"&gt;&lt;font face="Calibri"&gt;&lt;font style="font-size:11pt;"&gt;&amp;#160;&lt;a href="http://blogs.adatis.co.uk/blogs/philip/Blog1_1B02E630.png"&gt;&lt;img style="background-image:none;border-right-width:0px;padding-left:0px;padding-right:0px;display:inline;border-top-width:0px;border-bottom-width:0px;border-left-width:0px;padding-top:0px;" title="Blog1" border="0" alt="Blog1" src="http://blogs.adatis.co.uk/blogs/philip/Blog1_thumb_61EC092D.png" width="638" height="376" /&gt;&lt;/a&gt;&lt;/font&gt;&lt;/font&gt;&lt;/p&gt;  &lt;p style="line-height:13pt;page-break-after:avoid;margin:0cm 0cm 10pt 36pt;tab-stops:92.15pt;" class="MsoListParagraphCxSpLast"&gt;&lt;span style="mso-fareast-language:en-gb;mso-no-proof:yes;"&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p style="margin:0cm 0cm 10pt;" class="MsoCaption" align="center"&gt;&lt;font face="Calibri"&gt;&lt;font style="font-size:9pt;" color="#4f81bd"&gt;&lt;strong&gt;HTML Expression in Dataset Parameters&lt;/strong&gt;&lt;/font&gt;&lt;/font&gt;&lt;/p&gt;  &lt;p style="line-height:13pt;margin:0cm 0cm 0pt 36pt;tab-stops:92.15pt;" class="MsoListParagraphCxSpFirst"&gt;&lt;font face="Calibri"&gt;&lt;font style="font-size:11pt;"&gt;&amp;#160;&lt;/font&gt;&lt;/font&gt;&lt;/p&gt;  &lt;p style="line-height:13pt;margin:0cm 0cm 10pt 36pt;tab-stops:92.15pt;" class="MsoListParagraphCxSpLast"&gt;   &lt;br /&gt;&lt;font face="Calibri"&gt;&lt;font style="font-size:11pt;"&gt;The incomplete generated link being passed to the dataset will look something like this:&lt;/font&gt;&lt;/font&gt;&lt;/p&gt;  &lt;p style="line-height:13pt;margin:0cm 0cm 10pt 18pt;tab-stops:92.15pt;" class="MsoNormal"&gt;&lt;span style="mso-fareast-language:en-gb;mso-no-proof:yes;"&gt;&lt;/span&gt;    &lt;br /&gt;&lt;a href="http://blogs.adatis.co.uk/blogs/philip/image_7AE7D972.png"&gt;&lt;img style="background-image:none;border-right-width:0px;padding-left:0px;padding-right:0px;display:block;float:none;border-top-width:0px;border-bottom-width:0px;margin-left:auto;border-left-width:0px;margin-right:auto;padding-top:0px;" title="image" border="0" alt="image" src="http://blogs.adatis.co.uk/blogs/philip/image_thumb_28D52C2B.png" width="611" height="29" /&gt;&lt;/a&gt;     &lt;br style="mso-special-character:line-break;" /&gt;    &lt;br style="mso-special-character:line-break;" /&gt;&lt;/p&gt;  &lt;ul&gt;   &lt;li&gt;     &lt;div style="line-height:13pt;page-break-after:avoid;text-indent:-18pt;margin:0cm 0cm 10pt 36pt;mso-list:l0 level1 lfo3;tab-stops:92.15pt;" class="MsoListParagraph"&gt;&lt;font face="Calibri"&gt;&lt;font style="font-size:11pt;"&gt;In your dataset, complete your link with the missing parameter. &lt;/font&gt;&lt;/font&gt;        &lt;br /&gt;        &lt;br /&gt;&lt;/div&gt;   &lt;/li&gt; &lt;/ul&gt; &lt;span style="mso-fareast-language:en-gb;mso-no-proof:yes;"&gt;&lt;/span&gt;  &lt;p style="margin:0cm 0cm 10pt;" class="MsoCaption" align="center"&gt;&lt;font face="Calibri"&gt;&lt;font style="font-size:9pt;" color="#4f81bd"&gt;&lt;strong&gt;&lt;a href="http://blogs.adatis.co.uk/blogs/philip/Blog3_41D0FC70.png"&gt;&lt;img style="background-image:none;border-right-width:0px;padding-left:0px;padding-right:0px;display:inline;border-top-width:0px;border-bottom-width:0px;border-left-width:0px;padding-top:0px;" title="Blog3" border="0" alt="Blog3" src="http://blogs.adatis.co.uk/blogs/philip/Blog3_thumb_5ACCCCB5.png" width="636" height="234" /&gt;&lt;/a&gt;           &lt;br /&gt;          &lt;br /&gt;Complete your HTML Expression and Create Hyperlink&lt;/strong&gt;&lt;/font&gt;&lt;/font&gt;&lt;/p&gt;  &lt;p style="line-height:13pt;margin:0cm 0cm 0pt 36pt;tab-stops:92.15pt;" class="MsoListParagraphCxSpFirst"&gt;&lt;font face="Calibri"&gt;&lt;font style="font-size:11pt;"&gt;It may be worth pointing out at this stage you can also add other HTML tags to edit the look of the text. You can add bolding to the text – as in my example above, or even have some conditional formatting to colour code the text. For example green for high percentiles etc.&lt;span style="mso-spacerun:yes;"&gt;&amp;#160; &lt;/span&gt;(see the list of HTML tags available at the beginning of this post).&lt;/font&gt;&lt;/font&gt;     &lt;br style="mso-special-character:line-break;" /&gt;    &lt;br style="mso-special-character:line-break;" /&gt;&lt;/p&gt;  &lt;ul&gt;   &lt;li&gt;     &lt;div style="line-height:13pt;page-break-after:avoid;text-indent:-18pt;margin:0cm 0cm 10pt 36pt;mso-list:l0 level1 lfo3;tab-stops:92.15pt;" class="MsoListParagraphCxSpLast"&gt;&lt;font face="Calibri"&gt;&lt;font style="font-size:11pt;"&gt;For this example, I am just linking back into the same report and passing in the category that has been clicked. You can of course link to a different report/Drill through.            &lt;br /&gt;You end up with something like this&lt;/font&gt;&lt;/font&gt;         &lt;br /&gt;        &lt;br /&gt;&lt;/div&gt;   &lt;/li&gt; &lt;/ul&gt; &lt;span style="mso-fareast-language:en-gb;mso-no-proof:yes;"&gt;&lt;/span&gt;  &lt;p style="margin:0cm 0cm 10pt;" class="MsoCaption" align="center"&gt;&lt;a href="http://blogs.adatis.co.uk/blogs/philip/image_73C89CFA.png"&gt;&lt;img style="background-image:none;border-right-width:0px;padding-left:0px;padding-right:0px;display:inline;border-top-width:0px;border-bottom-width:0px;border-left-width:0px;padding-top:0px;" title="image" border="0" alt="image" src="http://blogs.adatis.co.uk/blogs/philip/image_thumb_3AB1BFF8.png" width="552" height="440" /&gt;&lt;/a&gt;&lt;/p&gt;  &lt;p style="margin:0cm 0cm 10pt;" class="MsoCaption" align="center"&gt;&lt;font face="Calibri"&gt;&lt;font style="font-size:9pt;" color="#4f81bd"&gt;&lt;strong&gt;How it will look&lt;/strong&gt;&lt;/font&gt;&lt;/font&gt;&lt;/p&gt;  &lt;p style="line-height:13pt;margin:0cm 0cm 10pt 36pt;tab-stops:92.15pt;" class="MsoListParagraph"&gt;   &lt;br /&gt;&lt;font face="Calibri"&gt;&lt;font style="font-size:11pt;"&gt;You can find the example RDL &lt;a href="http://blogs.adatis.co.uk/files/folders/10325/download.aspx"&gt;here&lt;/a&gt;. I used the AdventureWorksDW2008R2 Database.&lt;/font&gt;&lt;/font&gt;&lt;/p&gt;&lt;img src="http://blogs.adatis.co.uk/aggbug.aspx?PostID=10322" width="1" height="1"&gt;</description><category domain="http://blogs.adatis.co.uk/blogs/philip/archive/tags/SSRS/default.aspx">SSRS</category><category domain="http://blogs.adatis.co.uk/blogs/philip/archive/tags/SSRS+HTML/default.aspx">SSRS HTML</category><category domain="http://blogs.adatis.co.uk/blogs/philip/archive/tags/Reporting+Services/default.aspx">Reporting Services</category></item></channel></rss>