<?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/"
	xmlns:creativeCommons="http://backend.userland.com/creativeCommonsRssModule"
>

<channel>
	<title>From the Desk of Brandon Haynes &#187; Microsoft Sql Server Reporting Services (SSRS)</title>
	<atom:link href="http://blogs.law.harvard.edu/brandonhaynes/category/technology/microsoft-sql-server-reporting-services-ssrs/feed/" rel="self" type="application/rss+xml" />
	<link>http://blogs.law.harvard.edu/brandonhaynes</link>
	<description>Observations about the intersection of technology, business, and intellectual property</description>
	<lastBuildDate>Wed, 21 Oct 2009 16:14:28 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.8.4</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<creativeCommons:license>http://creativecommons.org/licenses/by-sa/3.0/us/</creativeCommons:license>
		<item>
		<title>Changing the Size of ReportViewer Parameter Dropdown List</title>
		<link>http://blogs.law.harvard.edu/brandonhaynes/2008/09/24/changing-the-size-of-reportviewer-parameter-dropdown-list/</link>
		<comments>http://blogs.law.harvard.edu/brandonhaynes/2008/09/24/changing-the-size-of-reportviewer-parameter-dropdown-list/#comments</comments>
		<pubDate>Wed, 24 Sep 2008 17:07:05 +0000</pubDate>
		<dc:creator>Brandon Haynes</dc:creator>
				<category><![CDATA[Microsoft Sql Server Reporting Services (SSRS)]]></category>
		<category><![CDATA[Technology]]></category>
		<category><![CDATA[Microsoft Reporting Services]]></category>
		<category><![CDATA[Reporting Services]]></category>
		<category><![CDATA[ReportViewer]]></category>
		<category><![CDATA[SSRS]]></category>

		<guid isPermaLink="false">http://blogs.law.harvard.edu/brandonhaynes/?p=20</guid>
		<description><![CDATA[I recently encountered an issue with the SSRS ReportViewer control where the parameter drop-down list was of insufficient width for the parameters contained therein.  Surprisingly, a search yielded no solutions.  Indeed, several individuals indicated that changing this width was not possible.
Fortunately, it does turn out to be possible.

Firing up the IE developer toolbar, I immediately noted [...]]]></description>
			<content:encoded><![CDATA[<p style="text-align: justify"><a href="http://blogs.law.harvard.edu/brandonhaynes/files/2008/09/before.png" rel="lightbox[20]"><img class="alignright alignnone size-medium wp-image-21" style="float: right;margin-left: 12px;margin-right: 12px;border: black 1px solid" src="http://blogs.law.harvard.edu/brandonhaynes/files/2008/09/before-300x100.png" alt="SSRS Report Viewer Parameters Dropdown (Before)" width="300" height="100" /></a>I recently encountered an issue with the SSRS <a href="http://www.gotreportviewer.com/">ReportViewer</a> control where the parameter drop-down list was of insufficient width for the parameters contained therein.  Surprisingly, a <a href="http://www.google.com/search?q=reportviewer+changing+parameter+dropdown+width">search</a> yielded no solutions.  Indeed, several individuals indicated that changing this width was not possible.</p>
<p>Fortunately, it does turn out to be possible.</p>
<p><span id="more-20"></span></p>
<p style="text-align: justify">Firing up the <a href="http://en.wikipedia.org/wiki/IE_Developer_Toolbar">IE developer toolbar</a>, I immediately noted that (a) parameter controls were rendered outside the document hierarchy (in this case at the end of the FORM), (b) there was no class specified anywhere within the internal ReportViewer tag hierarchy, and (c) styles were hard-coded directly on the DIV tag which held the drop-down list (implemented as a TABLE).  Indeed, the width attribute on this DIV was hard-coded at 184px.  By default, the parameters dropdown appears as:</p>
<p style="text-align: center"><a href="http://blogs.law.harvard.edu/brandonhaynes/files/2008/09/before.png" rel="lightbox[20]"></a></p>
<p style="text-align: justify">Fortunately, while there was no specific class to hang a custom width from, it turns out that the id of this DIV was reliably predictable.  As such, a judiciously constructed style could indeed target (and thereby style) this tag.</p>
<p>The form of the id on the DIV in question is [Viewer ClientId]_ctl00_ctl03_divDropDown.  Here, ctl00 is the automatically-generated id of the Microsoft.Reporting.WebForms.ParametersArea control, and ctl03 is the id of the Microsoft.Reporting.WebForms.MultiValueValidValuesControl.</p>
<p>Putting this together, an initial style would read as:</p>
<p style="padding-left: 30px"><span style="font-size: x-small;color: #0000ff">&lt;</span><span style="font-size: x-small;color: #a31515">style</span><span style="font-size: x-small"> </span><span style="font-size: x-small;color: #ff0000">type</span><span style="font-size: x-small;color: #0000ff">=&#8221;text/css&#8221;&gt;<br />
</span><span style="font-size: x-small;color: #a31515">     DIV#&lt;%=</span><span style="font-size: x-small"> </span><span style="font-size: x-small;color: #a31515">Viewer.ClientID</span><span style="font-size: x-small"> %</span><span style="font-size: x-small;color: #a31515">&gt;</span><span style="font-size: x-small;color: #a31515">_ctl00_ctl03_divDropDown</span><span style="font-size: x-small"><span style="font-size: x-small"><br />
          {<br />
</span></span><span style="font-size: x-small"><span style="font-size: x-small"><span style="font-size: x-small;color: #ff0000">          width</span><span style="font-size: x-small">: </span><span style="font-size: x-small;color: #0000ff">320px</span><span style="font-size: x-small"> </span><span style="font-size: x-small;color: #0000ff">!important</span><span style="font-size: x-small">;<br />
          }<br />
</span></span></span><span style="font-size: x-small;color: #0000ff"><span style="font-size: x-small;color: #0000ff">&lt;/</span></span><span style="font-size: x-small;color: #0000ff"><span style="font-size: x-small;color: #0000ff"><span style="font-size: x-small;color: #a31515">style&gt;</span></span></span></p>
<p style="padding-left: 30px"><span style="font-size: x-small;color: #0000ff"><span style="font-size: x-small;color: #0000ff"><span style="color: #a31515">&lt;</span></span></span><span style="font-size: x-small;color: #a31515">rsweb</span><span style="font-size: x-small;color: #0000ff">:</span><span style="font-size: x-small;color: #a31515">ReportViewer</span><span style="font-size: x-small"> </span><span style="font-size: x-small;color: #ff0000">ID</span><span style="font-size: x-small;color: #0000ff">=&#8221;Viewer&#8221;</span><span style="font-size: x-small"> </span><span style="font-size: x-small;color: #ff0000">runat</span><span style="font-size: x-small;color: #0000ff">=&#8221;server&#8221;</span><span style="font-size: x-small"> </span><span style="font-size: x-small;color: #ff0000">Width</span><span style="font-size: x-small;color: #0000ff">=&#8221;100%&#8221;</span><span style="font-size: x-small"> </span><span style="font-size: x-small;color: #ff0000">Height</span><span style="font-size: x-small;color: #0000ff">=&#8221;600px&#8221;</span><span style="font-size: x-small"> </span><span style="font-size: x-small;color: #ff0000">ProcessingMode</span><span style="font-size: x-small;color: #0000ff">=&#8221;Remote&#8221;</span><span style="font-size: x-small"> </span><span style="font-size: x-small;color: #0000ff">/&gt;</span></p>
<p style="text-align: justify"><a href="http://blogs.law.harvard.edu/brandonhaynes/files/2008/09/after.png" rel="lightbox[20]"><img class="size-medium wp-image-22" style="float: right;margin-left: 12px;margin-right: 12px" src="http://blogs.law.harvard.edu/brandonhaynes/files/2008/09/after-300x100.png" alt="SSRS ReportViewer Parameter Dropdown (After)" width="300" height="100" /></a>Here we use the ClientID the ReportViewer (and its constituent ctl00 and ctl03 child and grandchild, respectively).  We also use an &#8220;!important&#8221; declaration to override the inline styling.  After our style is applied, the ReportViewer dropdown may be set to any size.</p>
<p style="text-align: justify">Note that it would be of better form to create a custom function that recurses the ReportViewer control hierarchy to locate the divDropDown control (and use its ClientID).  This would make the solution a bit more forward-looking and upgrade-friendly.  I leave this as an exercise to the reader (there are plenty of <a href="http://www.google.com/search?q=asp.net+recurse+the+control+tree">tutorials</a> out there about recursing the control tree).</p>
<p>Hope this helps anyone needing to resize this particular control.</p>
<p>B</p>



Share on:


	<a rel="nofollow" id="digg" href="javascript:window.location='http%3A%2F%2Fdigg.com%2Fsubmit%3Fphase%3D2%26amp%3Burl%3Dhttp%253A%252F%252Fblogs.law.harvard.edu%252Fbrandonhaynes%252F2008%252F09%252F24%252Fchanging-the-size-of-reportviewer-parameter-dropdown-list%252F%26amp%3Btitle%3DChanging%2520the%2520Size%2520of%2520ReportViewer%2520Parameter%2520Dropdown%2520List%26amp%3Bbodytext%3DI%2520recently%2520encountered%2520an%2520issue%2520with%2520the%2520SSRS%2520ReportViewer%2520control%2520where%2520the%2520parameter%2520drop-down%2520list%2520was%2520of%2520insufficient%2520width%2520for%2520the%2520parameters%2520contained%2520therein.%25C2%25A0%2520Surprisingly%252C%2520a%2520search%25C2%25A0yielded%2520no%2520solutions.%25C2%25A0%2520Indeed%252C%2520several%2520individuals%2520indica';" title="Digg"><img src="http://blogs.law.harvard.edu/brandonhaynes/wp-content/plugins/sociable/images/digg.png" title="Digg" alt="Digg" class="sociable-hovers" /></a>
	<a rel="nofollow" id="del.icio.us" href="javascript:window.location='http%3A%2F%2Fdelicious.com%2Fpost%3Furl%3Dhttp%253A%252F%252Fblogs.law.harvard.edu%252Fbrandonhaynes%252F2008%252F09%252F24%252Fchanging-the-size-of-reportviewer-parameter-dropdown-list%252F%26amp%3Btitle%3DChanging%2520the%2520Size%2520of%2520ReportViewer%2520Parameter%2520Dropdown%2520List%26amp%3Bnotes%3DI%2520recently%2520encountered%2520an%2520issue%2520with%2520the%2520SSRS%2520ReportViewer%2520control%2520where%2520the%2520parameter%2520drop-down%2520list%2520was%2520of%2520insufficient%2520width%2520for%2520the%2520parameters%2520contained%2520therein.%25C2%25A0%2520Surprisingly%252C%2520a%2520search%25C2%25A0yielded%2520no%2520solutions.%25C2%25A0%2520Indeed%252C%2520several%2520individuals%2520indica';" title="del.icio.us"><img src="http://blogs.law.harvard.edu/brandonhaynes/wp-content/plugins/sociable/images/delicious.png" title="del.icio.us" alt="del.icio.us" class="sociable-hovers" /></a>
	<a rel="nofollow" id="facebook" href="javascript:window.location='http%3A%2F%2Fwww.facebook.com%2Fshare.php%3Fu%3Dhttp%253A%252F%252Fblogs.law.harvard.edu%252Fbrandonhaynes%252F2008%252F09%252F24%252Fchanging-the-size-of-reportviewer-parameter-dropdown-list%252F%26amp%3Bt%3DChanging%2520the%2520Size%2520of%2520ReportViewer%2520Parameter%2520Dropdown%2520List';" title="Facebook"><img src="http://blogs.law.harvard.edu/brandonhaynes/wp-content/plugins/sociable/images/facebook.png" title="Facebook" alt="Facebook" class="sociable-hovers" /></a>
	<a rel="nofollow" id="google" href="javascript:window.location='http%3A%2F%2Fwww.google.com%2Fbookmarks%2Fmark%3Fop%3Dedit%26amp%3Bbkmk%3Dhttp%253A%252F%252Fblogs.law.harvard.edu%252Fbrandonhaynes%252F2008%252F09%252F24%252Fchanging-the-size-of-reportviewer-parameter-dropdown-list%252F%26amp%3Btitle%3DChanging%2520the%2520Size%2520of%2520ReportViewer%2520Parameter%2520Dropdown%2520List%26amp%3Bannotation%3DI%2520recently%2520encountered%2520an%2520issue%2520with%2520the%2520SSRS%2520ReportViewer%2520control%2520where%2520the%2520parameter%2520drop-down%2520list%2520was%2520of%2520insufficient%2520width%2520for%2520the%2520parameters%2520contained%2520therein.%25C2%25A0%2520Surprisingly%252C%2520a%2520search%25C2%25A0yielded%2520no%2520solutions.%25C2%25A0%2520Indeed%252C%2520several%2520individuals%2520indica';" title="Google Bookmarks"><img src="http://blogs.law.harvard.edu/brandonhaynes/wp-content/plugins/sociable/images/googlebookmark.png" title="Google Bookmarks" alt="Google Bookmarks" class="sociable-hovers" /></a>
	<a rel="nofollow" id="dotnetkicks" href="javascript:window.location='http%3A%2F%2Fwww.dotnetkicks.com%2Fkick%2F%3Furl%3Dhttp%253A%252F%252Fblogs.law.harvard.edu%252Fbrandonhaynes%252F2008%252F09%252F24%252Fchanging-the-size-of-reportviewer-parameter-dropdown-list%252F%26amp%3Btitle%3DChanging%2520the%2520Size%2520of%2520ReportViewer%2520Parameter%2520Dropdown%2520List';" title="DotNetKicks"><img src="http://blogs.law.harvard.edu/brandonhaynes/wp-content/plugins/sociable/images/dotnetkicks.png" title="DotNetKicks" alt="DotNetKicks" class="sociable-hovers" /></a>
	<a rel="nofollow" id="linkedin" href="javascript:window.location='http%3A%2F%2Fwww.linkedin.com%2FshareArticle%3Fmini%3Dtrue%26amp%3Burl%3Dhttp%253A%252F%252Fblogs.law.harvard.edu%252Fbrandonhaynes%252F2008%252F09%252F24%252Fchanging-the-size-of-reportviewer-parameter-dropdown-list%252F%26amp%3Btitle%3DChanging%2520the%2520Size%2520of%2520ReportViewer%2520Parameter%2520Dropdown%2520List%26amp%3Bsource%3DFrom%2Bthe%2BDesk%2Bof%2BBrandon%2BHaynes%2BObservations%2Babout%2Bthe%2Bintersection%2Bof%2Btechnology%252C%2Bbusiness%252C%2Band%2Bintellectual%2Bproperty%26amp%3Bsummary%3DI%2520recently%2520encountered%2520an%2520issue%2520with%2520the%2520SSRS%2520ReportViewer%2520control%2520where%2520the%2520parameter%2520drop-down%2520list%2520was%2520of%2520insufficient%2520width%2520for%2520the%2520parameters%2520contained%2520therein.%25C2%25A0%2520Surprisingly%252C%2520a%2520search%25C2%25A0yielded%2520no%2520solutions.%25C2%25A0%2520Indeed%252C%2520several%2520individuals%2520indica';" title="LinkedIn"><img src="http://blogs.law.harvard.edu/brandonhaynes/wp-content/plugins/sociable/images/linkedin.png" title="LinkedIn" alt="LinkedIn" class="sociable-hovers" /></a>
	<a rel="nofollow" id="stumbleupon" href="javascript:window.location='http%3A%2F%2Fwww.stumbleupon.com%2Fsubmit%3Furl%3Dhttp%253A%252F%252Fblogs.law.harvard.edu%252Fbrandonhaynes%252F2008%252F09%252F24%252Fchanging-the-size-of-reportviewer-parameter-dropdown-list%252F%26amp%3Btitle%3DChanging%2520the%2520Size%2520of%2520ReportViewer%2520Parameter%2520Dropdown%2520List';" title="StumbleUpon"><img src="http://blogs.law.harvard.edu/brandonhaynes/wp-content/plugins/sociable/images/stumbleupon.png" title="StumbleUpon" alt="StumbleUpon" class="sociable-hovers" /></a>
	<a rel="nofollow" id="technorati" href="javascript:window.location='http%3A%2F%2Ftechnorati.com%2Ffaves%3Fadd%3Dhttp%253A%252F%252Fblogs.law.harvard.edu%252Fbrandonhaynes%252F2008%252F09%252F24%252Fchanging-the-size-of-reportviewer-parameter-dropdown-list%252F';" title="Technorati"><img src="http://blogs.law.harvard.edu/brandonhaynes/wp-content/plugins/sociable/images/technorati.png" title="Technorati" alt="Technorati" class="sociable-hovers" /></a>


<br/><br/>]]></content:encoded>
			<wfw:commentRss>http://blogs.law.harvard.edu/brandonhaynes/2008/09/24/changing-the-size-of-reportviewer-parameter-dropdown-list/feed/</wfw:commentRss>
		<slash:comments>5</slash:comments>
	<creativeCommons:license>http://creativecommons.org/licenses/by-sa/3.0/us/</creativeCommons:license>
	</item>
	</channel>
</rss>
