<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Luke Hayler - SQL Server developer &#187; report formatting</title>
	<atom:link href="http://www.lukehayler.com/tag/report-formatting/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.lukehayler.com</link>
	<description>A blog about Integration services, Reporting services, and the things that interest me</description>
	<lastBuildDate>Tue, 08 Jun 2010 20:50:11 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.1</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>Custom Visibility Toggling SSRS 2008</title>
		<link>http://www.lukehayler.com/2010/02/custom-visibility-toggling-ssrs-2008/</link>
		<comments>http://www.lukehayler.com/2010/02/custom-visibility-toggling-ssrs-2008/#comments</comments>
		<pubDate>Mon, 15 Feb 2010 11:00:00 +0000</pubDate>
		<dc:creator>Luke Hayler</dc:creator>
				<category><![CDATA[Reporting Services]]></category>
		<category><![CDATA[report design]]></category>
		<category><![CDATA[report formatting]]></category>
		<category><![CDATA[report layout]]></category>
		<category><![CDATA[sql server 2008]]></category>
		<category><![CDATA[SSRS]]></category>
		<category><![CDATA[SSRS 2008]]></category>

		<guid isPermaLink="false">http://www.lukehayler.com/2010/02/custom-visibility-toggling-ssrs-2008/</guid>
		<description><![CDATA[A while back I wrote a post about how to toggle the visibility of rows/columns in tables/matrices for SSRS 2005. In the comments of that article someone asked how this was done in SSRS 2008. The short answer was that the method is the same. However, setting all the properties can be confusing as their [...]]]></description>
			<content:encoded><![CDATA[<p>A while back I wrote <a href="http://www.lukehayler.com/2009/07/custom-visibility-toggling-in-ssrs/" target="_blank">a post about how to toggle the visibility of rows/columns in tables/matrices for SSRS 2005</a>. In the comments of that article someone asked how this was done in SSRS 2008. The short answer was that the method is the same. However, setting all the properties can be confusing as their whereabouts is a little different. Hopefully this post will clear things up.</p>
<p>Let’s do this by way of example:</p>
<p>I created a project with a single report. The Data source is AdventureWorks2008 and we are looking at Total Sales figures by Year &amp; Month (keep it simple right?). I have set up a matrix object and added the required fields and set subtotals for Month &amp; Year. See Fig 1. below:</p>
<div id="scid:8747F07C-CDE8-481f-B0DF-C6CFD074BF67:a1c7e7a5-d745-4bd8-aaec-d4842b51d68e" class="wlWriterEditableSmartContent" style="margin: 0px; display: inline; float: none; padding: 0px;"><a title="Fig 1. The design surface with a Matrix Object" rel="thumbnail" href="http://www.lukehayler.com/wp-content/uploads/2010/02/InitialToggleState_SSRS2008_DesignSurface8x6.png"><img src="http://www.lukehayler.com/wp-content/uploads/2010/02/InitialToggleState_SSRS2008_DesignSurface.png" border="0" alt="" width="600" height="392" /></a></div>
<h6>Objective: Enable Toggling of the Month group, using the Year Group as the Toggle Item</h6>
<p>At this point I want to point out two key areas, as this is where we will be concentrating our efforts:</p>
<ol>
<li>The Row/Column Groups section at the bottom of the designer</li>
<li>The Visibility Properties at the bottom right corner (Last item in the Properties list &#8211; <em>but only when an object is selected</em>)</li>
</ol>
<p>Now, select the drop-down arrow for the <strong>Month</strong> Row group (See Fig 2.), choose <strong>Properties</strong> and then select the <strong>Visibility</strong> tab.</p>
<div id="scid:8747F07C-CDE8-481f-B0DF-C6CFD074BF67:35a4a701-2301-498f-a113-dd12cc705a53" class="wlWriterEditableSmartContent" style="margin: 0px; display: inline; float: none; padding: 0px;"><a title="Fig 2. Accessing the Row Group Properties" rel="thumbnail" href="http://www.lukehayler.com/wp-content/uploads/2010/02/InitialToggleState_SSRS2008_RowGroupProperties8x6.png"><img src="http://www.lukehayler.com/wp-content/uploads/2010/02/InitialToggleState_SSRS2008_RowGroupProperties.png" border="0" alt="" width="425" height="413" /></a></div>
<p>The objective is to enable toggling of the <strong>Month</strong> rows in the Matrix. We could choose to Show or Hide the <strong>Month</strong> rows when the report is initially run, or to make this decision based on an expression. Using an expression will determine which rows are expanded and which are collapsed when the report is run initially. I have chosen to use an expression:</p>
<blockquote><p>=IIF(Fields!YEAR.value=2001, False, True)</p></blockquote>
<p>This says that if the Year group value is ‘2001’ then show the Month Sales Total values (‘Expanded’), else Hide the Month Sales Total values (‘Collapsed’). See Fig 3. below:</p>
<div id="scid:8747F07C-CDE8-481f-B0DF-C6CFD074BF67:15396b28-610f-4a51-a7d1-b7a0a1e9e5bc" class="wlWriterEditableSmartContent" style="margin: 0px; display: inline; float: none; padding: 0px;"><a title="Fig. 3 The Month Group Visibility Properties" rel="thumbnail" href="http://www.lukehayler.com/wp-content/uploads/2010/02/InitialToggleState_SSRS2008_RowGroupProperties_VisibilityExpression8x6.png"><img src="http://www.lukehayler.com/wp-content/uploads/2010/02/InitialToggleState_SSRS2008_RowGroupProperties_VisibilityExpression.png" border="0" alt="" width="600" height="318" /></a></div>
<p>Also note (in Fig 3. above) that I have set the <strong>YEAR</strong> cell as the Toggle Item. We’ll configure this next.</p>
<p>Once you have set the above properties go back to the designer and highlight the <strong>YEAR</strong> cell in order to view its properties. These should be on the bottom right, otherwise right-click the cell to bring up the properties window. Find the <strong>Visibility</strong> &gt; <strong>InitialToggleState</strong> property and set it using the following Expression:</p>
<blockquote><p>=IIF(Fields!YEAR.Value = 2001, True, False)</p></blockquote>
<p>This says that if the Year group value is ‘2001’ then show the toggle icon as ‘Expanded’ (True), else show it as ‘Collapsed’ (False). This allows us to ensure that we are in sync with the expression we used to set the initial visibility of the Month rows. Fig 4. shows the end result of all this hard work:</p>
<div id="scid:8747F07C-CDE8-481f-B0DF-C6CFD074BF67:755fb2c3-916d-4a9b-875a-5e2b327ddc2e" class="wlWriterEditableSmartContent" style="margin: 0px; display: inline; float: none; padding: 0px;"><a title="Fig 4. Result!" rel="thumbnail" href="http://www.lukehayler.com/wp-content/uploads/2010/02/InitialToggleState_SSRS2008_result8x6.png"><img src="http://www.lukehayler.com/wp-content/uploads/2010/02/InitialToggleState_SSRS2008_result.png" border="0" alt="" width="381" height="424" /></a></div>
<div id="scid:8747F07C-CDE8-481f-B0DF-C6CFD074BF67:ce9f2350-42e3-446e-a2b8-56356e803cb0" class="wlWriterEditableSmartContent" style="margin: 0px; display: inline; float: right; padding: 0px;">
</div>
<h4></h4>
<h4>The Visibility Properties</h4>
<p><a title="TextBox Visibility Properties" rel="thumbnail" href="http://www.lukehayler.com/wp-content/uploads/2010/02/InitialToggleState_SSRS2008_VisibilityProperties8x6.png"><img class="alignright" style="border: 0px initial initial;" src="http://www.lukehayler.com/wp-content/uploads/2010/02/InitialToggleState_SSRS2008_VisibilityProperties.png" border="0" alt="" width="300" height="311" /></a></p>
<p>Understanding what each of the three visibility properties does will help to use them effectively.</p>
<p><strong>Hidden &#8211; </strong>Can be set to either ‘True’ or ‘False’. This can be done by selecting True or False from the drop down, or by using an expression to set either of those values after evaluating a condition. True equates to the object being hidden and False to the object being shown (tricky eh?).</p>
<p><strong>InitialToggleState</strong> &#8211; This is only applicable if the object that you have selected can toggle the visibility of other objects. It refers to the state of the toggle icon and can either be ‘Collapsed’ (‘+’) or ‘Expanded’ (‘-‘). As explained by way of example above, setting this to &#8216;’True’ sets the icon to the ‘Expanded’ state, and False to the ‘Collapsed’ state.</p>
<p><strong>ToggleItem</strong> &#8211; Use this property to set the object that will enable the user to toggle the visibility of another item. In the example above, I have chosen <strong>YEAR</strong> as my toggle item for the <strong>Month Group</strong>.</p>
<div id="scid:8747F07C-CDE8-481f-B0DF-C6CFD074BF67:4d34549f-83cb-4e47-af5f-7f400f868789" class="wlWriterEditableSmartContent" style="margin: 0px; display: inline; float: right; padding: 0px;"><a title="Fig 4. Oops" rel="thumbnail" href="http://www.lukehayler.com/wp-content/uploads/2010/02/InitialToggleState_SSRS2008_Oops8x6.png"><img src="http://www.lukehayler.com/wp-content/uploads/2010/02/InitialToggleState_SSRS2008_Oops.png" border="0" alt="" width="342" height="524" /></a></div>
<h4>Beware the Gremlins</h4>
<p>You need to be aware of setting properties for the right objects or groups, or you may find that your report does not display correctly:</p>
<p>Fig 4. shows what happens when you set the Visibility properties for the <strong>Month &amp; Data CELLS</strong> in the report instead of the <strong>Month Group</strong> properties. Setting the Month Group visibility properties means that you won’t get that nasty white space, and there’s no need to set the visibility of the cells (in this instance).</p>
<p>I have placed the example project in <a href="http://www.lukehayler.com/wp-content/uploads/2010/02/VisibilityTogglingSSRS2008.zip" target="_blank">a nice little zip file</a> for all you folks that might want such a thing.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.lukehayler.com/2010/02/custom-visibility-toggling-ssrs-2008/feed/</wfw:commentRss>
		<slash:comments>13</slash:comments>
		</item>
		<item>
		<title>Custom Visibility Toggling in SSRS</title>
		<link>http://www.lukehayler.com/2009/07/custom-visibility-toggling-in-ssrs/</link>
		<comments>http://www.lukehayler.com/2009/07/custom-visibility-toggling-in-ssrs/#comments</comments>
		<pubDate>Thu, 16 Jul 2009 22:05:51 +0000</pubDate>
		<dc:creator>Luke Hayler</dc:creator>
				<category><![CDATA[Reporting Services]]></category>
		<category><![CDATA[Custom Settings]]></category>
		<category><![CDATA[report formatting]]></category>
		<category><![CDATA[Visibility Toggle]]></category>

		<guid isPermaLink="false">http://www.lukehayler.com/?p=32</guid>
		<description><![CDATA[I can see clearly now
The visibility property of Report items can be a little gem. You can set the initial visibility of an item to hidden/visible , use another report item (a parent group in a table or matrix) and set the initial appearance of the toggle icon (+/-) either absolutely or using expressions. By using [...]]]></description>
			<content:encoded><![CDATA[<p><strong>I can see clearly now</strong></p>
<p>The visibility property of Report items can be a little gem. You can set the initial visibility of an item to hidden/visible , use another report item (a parent group in a table or matrix) and set the initial appearance of the toggle icon (+/-) either absolutely or using expressions. By using expressions, you can dynamically determine whether or not the item should be hidden (or collapsed in the case of a table/matrix grouping), and subsequently set the initial appearance of the icon.</p>
<p>In the example below, <strong>textbox8 </strong>is my toggle item for the group “<em>Priority</em>“. When the report loads I want to show the “<em>critical</em>” items in an expanded state, and all other priorities in a collapsed state. By right-clicking on<strong>textbox8 </strong>and choosing properties I get the window below. Select Expression for the <em>Initial appearance</em> <em>of the icon</em> and enter a formula that will determine whether the <em>initial appearance</em> <em>of the icon</em> is expanded (’<span style="color: #3333ff;">true</span>‘) or collapsed (’<span style="color: #3333ff;">false</span>‘). What you use in your expression to evaluate whether or not the toggle item is expanded or collapsed is up to you.</p>
<p>Note. The above assumes that the Group &#8220;<em>Priority&#8221; </em>has already had it&#8217;s visibility set using an appropriate expression to show the &#8220;<em>Critical&#8221;</em> items expanded and all other collapsed when the report is run. It also assumes that the visibility of the group &#8220;<em>Priority</em>&#8221; is toggled by another item (textbox8).</p>
<div id="attachment_33" class="wp-caption aligncenter" style="width: 594px"><img class="size-full wp-image-33" title="ReportItemVisibilityProperties" src="http://www.lukehayler.com/wp-content/uploads/2009/07/toggleproperties.jpg" alt="Fig 1. Text Box Property dialog, showing the Visibility Tab" width="584" height="420" /><p class="wp-caption-text">Fig 1. Text Box Property dialog, showing the Visibility Tab</p></div>
<p>The result is shown in Fig 2.</p>
<dt class="wp-caption-dt"> </dt>
<dt class="wp-caption-dt"> </dt>
<dt class="wp-caption-dt"> </dt>
<dt class="wp-caption-dt"> </dt>
<dt class="wp-caption-dt"> </dt>
<dt class="wp-caption-dt"> </dt>
<dt class="wp-caption-dt"> </dt>
<dt class="wp-caption-dt"> </dt>
<dt class="wp-caption-dt"> </dt>
<dt class="wp-caption-dt"> </dt>
<dt class="wp-caption-dt"> </dt>
<dt class="wp-caption-dt"> </dt>
<dt class="wp-caption-dt"> </dt>
<dt class="wp-caption-dt"> </dt>
<dt class="wp-caption-dt"> </dt>
<dt class="wp-caption-dt"> </dt>
<dt class="wp-caption-dt"> </dt>
<dt class="wp-caption-dt"> </dt>
<dt class="wp-caption-dt"> </dt>
<dt class="wp-caption-dt"> </dt>
<dt class="wp-caption-dt"> </dt>
<dt class="wp-caption-dt"> </dt>
<dt class="wp-caption-dt"> </dt>
<dt class="wp-caption-dt"> </dt>
<dt class="wp-caption-dt"> </dt>
<dt class="wp-caption-dt"></dt>
<div class="mceTemp mceIEcenter" style="text-align: center;">
<dl id="attachment_35" class="wp-caption aligncenter" style="width: 249px;">
<dt class="wp-caption-dt"><img class="size-full wp-image-35 " title="VisibilityResult" src="http://www.lukehayler.com/wp-content/uploads/2009/07/VisibilityResult.jpg" alt="Fig 2. Result of setting custom visibility for a table group" width="239" height="136" /></dt>
<dd class="wp-caption-dd">Fig 2. Result of setting custom visibility for a table group</dd>
</dl>
</div>
<div class="mceTemp" style="text-align: left;"><span style="font-size: small;"><span style="line-height: 17px;">-luke </span></span></div>
]]></content:encoded>
			<wfw:commentRss>http://www.lukehayler.com/2009/07/custom-visibility-toggling-in-ssrs/feed/</wfw:commentRss>
		<slash:comments>15</slash:comments>
		</item>
	</channel>
</rss>
