<?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>Dutton Software &#187; non-queried parameters</title>
	<atom:link href="http://www.duttonsoftware.com/tag/non-queried-parameters/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.duttonsoftware.com</link>
	<description>Code, plug-ins &#38; more</description>
	<lastBuildDate>Mon, 16 Jan 2012 06:30:38 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
		<item>
		<title>Non-queried multi-value parameters in SQL Server Reporting Services</title>
		<link>http://www.duttonsoftware.com/2008/12/05/non-queried-multi-value-parameters-in-sql-server-reporting-services/</link>
		<comments>http://www.duttonsoftware.com/2008/12/05/non-queried-multi-value-parameters-in-sql-server-reporting-services/#comments</comments>
		<pubDate>Fri, 05 Dec 2008 07:39:49 +0000</pubDate>
		<dc:creator>Aaron</dc:creator>
				<category><![CDATA[SQL Server Reporting Services]]></category>
		<category><![CDATA[Multi-value parameters]]></category>
		<category><![CDATA[non-queried parameters]]></category>
		<category><![CDATA[SSRS]]></category>

		<guid isPermaLink="false">http://www.duttonsoftware.com/?p=117</guid>
		<description><![CDATA[As a follow-up to my previous post on Easy multi-value parameters in SQL Server Reporting Services, I wanted to point out some information on non-queried, or static multi-value parameters. For my example, I&#8217;m using a parameter named &#8220;Time&#8221; with choices &#8220;Morning&#8221;, &#8220;Noon&#8221;, and &#8220;Night&#8221;.  The values are M, N, and I respectively.  You can see [...]]]></description>
			<content:encoded><![CDATA[<p>As a follow-up to my previous post on <a title="Easy multi-value parameters in SQL Server Reporting Services" href="http://www.duttonsoftware.com/2008/09/25/easy-multi-value-parameters-in-sql-server-reporting-services/" target="_self">Easy multi-value parameters in SQL Server Reporting Services</a>, I wanted to point out some information on non-queried, or static multi-value parameters.</p>
<p>For my example, I&#8217;m using a parameter named &#8220;Time&#8221; with choices &#8220;Morning&#8221;, &#8220;Noon&#8221;, and &#8220;Night&#8221;.  The values are M, N, and I respectively.  You can see how I set up the parameter in the following screenshot.</p>
<p><a href="http://www.duttonsoftware.com/wp-content/uploads/2008/12/multi-value-parameters-non-queried-default-dialog.png"><img class="alignnone size-full wp-image-118" title="multi-value-parameters-non-queried-default-dialog" src="http://www.duttonsoftware.com/wp-content/uploads/2008/12/multi-value-parameters-non-queried-default-dialog.png" alt="" width="500" height="393" /></a></p>
<p>You can accomplish having all the checkboxes selected by default in two ways.  The first way is to pass an object array of values, and the easiest way to do that is to use the Split command to split a string into a string array.  I used <strong>=Split(&#8220;M,N,I&#8221;,&#8221;,&#8221;)</strong> as my default.  I had to provide the second parameter for Split, the delimiter, because the default is space.</p>
<p>The second, and easier method, is to just add a line item for each item you want checked, as demonstrated in this screenshot:</p>
<p><a href="http://www.duttonsoftware.com/wp-content/uploads/2008/12/multi-value-parameters-non-queried-default-simple-method.png"><img class="alignnone size-full wp-image-123" title="multi-value-parameters-non-queried-default-simple-method" src="http://www.duttonsoftware.com/wp-content/uploads/2008/12/multi-value-parameters-non-queried-default-simple-method.png" alt="" width="459" height="153" /></a></p>
<p>Here is the resulting parameter list, showing all the items selected (same for either method):</p>
<p><a href="http://www.duttonsoftware.com/wp-content/uploads/2008/12/multi-value-parameters-non-queried-default-results.png"><img class="alignnone size-full wp-image-119" title="multi-value-parameters-non-queried-default-results" src="http://www.duttonsoftware.com/wp-content/uploads/2008/12/multi-value-parameters-non-queried-default-results.png" alt="" width="244" height="56" /></a></p>
<p>Sometimes, you need to display the parameters of your report, perhaps so it could be regenerated later.  You&#8217;ll need to print out that object array, so use the opposite of Split, <strong>Join</strong>.  Below is a textbox with an expression of <strong>=Join(Parameters!Time.Label, &#8220;, &#8220;)</strong>, which joins the parameter values together with a comma and space separator.</p>
<p><a href="http://www.duttonsoftware.com/wp-content/uploads/2008/12/multi-value-parameters-non-queried-display-label-code.png"><img class="alignnone size-full wp-image-120" title="multi-value-parameters-non-queried-display-label-code" src="http://www.duttonsoftware.com/wp-content/uploads/2008/12/multi-value-parameters-non-queried-display-label-code.png" alt="" width="299" height="72" /></a></p>
<p>Here is the result of the code, with two parameters selected shown:</p>
<p><a href="http://www.duttonsoftware.com/wp-content/uploads/2008/12/multi-value-parameters-non-queried-display-label-results.png"><img class="alignnone size-full wp-image-121" title="multi-value-parameters-non-queried-display-label-results" src="http://www.duttonsoftware.com/wp-content/uploads/2008/12/multi-value-parameters-non-queried-display-label-results.png" alt="" width="254" height="154" /></a></p>
<p>If you only put the parameter label in the textbox (i.e. using code <strong>=Parameters!Time.Label</strong>) then when you display the report, you&#8217;ll get the famous Reporting Services #Error message.  You have to use <strong>Join</strong> in this case.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.duttonsoftware.com/2008/12/05/non-queried-multi-value-parameters-in-sql-server-reporting-services/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
	</channel>
</rss>

