<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	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:georss="http://www.georss.org/georss" xmlns:geo="http://www.w3.org/2003/01/geo/wgs84_pos#" xmlns:media="http://search.yahoo.com/mrss/"
		>
<channel>
	<title>Comments on: Using a Local Reporting Services 2008 Report with an ADO.NET Data Set</title>
	<atom:link href="http://arcanecode.com/2009/02/09/using-a-local-reporting-services-2008-report-with-an-adonet-data-set/feed/" rel="self" type="application/rss+xml" />
	<link>http://arcanecode.com/2009/02/09/using-a-local-reporting-services-2008-report-with-an-adonet-data-set/</link>
	<description>Making Microsoft .Net Development Magical</description>
	<lastBuildDate>Tue, 07 Feb 2012 16:57:33 +0000</lastBuildDate>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.com/</generator>
	<item>
		<title>By: Agustin</title>
		<link>http://arcanecode.com/2009/02/09/using-a-local-reporting-services-2008-report-with-an-adonet-data-set/#comment-29249</link>
		<dc:creator><![CDATA[Agustin]]></dc:creator>
		<pubDate>Tue, 12 Apr 2011 18:19:07 +0000</pubDate>
		<guid isPermaLink="false">http://arcanecode.wordpress.com/2009/02/09/using-a-local-reporting-services-2008-report-with-an-adonet-data-set/#comment-29249</guid>
		<description><![CDATA[Muchas gracias por el ejemplo, ¡me fue de gran ayuda!]]></description>
		<content:encoded><![CDATA[<p>Muchas gracias por el ejemplo, ¡me fue de gran ayuda!</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Kritul Tulsidas Rathod</title>
		<link>http://arcanecode.com/2009/02/09/using-a-local-reporting-services-2008-report-with-an-adonet-data-set/#comment-29242</link>
		<dc:creator><![CDATA[Kritul Tulsidas Rathod]]></dc:creator>
		<pubDate>Sun, 10 Apr 2011 13:54:49 +0000</pubDate>
		<guid isPermaLink="false">http://arcanecode.wordpress.com/2009/02/09/using-a-local-reporting-services-2008-report-with-an-adonet-data-set/#comment-29242</guid>
		<description><![CDATA[Hi There is just a small improvement here ... 
I followed the steps mentioned in the article and was able to get desired result. However, I learned that once the report has been loaded with the data it doesn&#039;t change the value.

My requirement was to add a text box along with the button to refresh the report. when user put some integer value in the text box and hit the button the data should be refreshed by using that integer value as filter (where clause in the query (variable: qry here).

Since the rvwMain.LocalReport.DataSources is a collection the report implicitly takes the first added source as the source to refresh the report in subsequent button clicks.

To resolve this issue I just cleared the DataSources  collection of the LocalReport to get the desired result.
Here is how to do it.

 rvwMain.LocalReport.DataSources.Clear();
rvwMain.LocalReport.DataSources.Add(...);

Just thought share it with everyone hoping that it might help the readers.

Thanks,
Kritul]]></description>
		<content:encoded><![CDATA[<p>Hi There is just a small improvement here &#8230;<br />
I followed the steps mentioned in the article and was able to get desired result. However, I learned that once the report has been loaded with the data it doesn&#8217;t change the value.</p>
<p>My requirement was to add a text box along with the button to refresh the report. when user put some integer value in the text box and hit the button the data should be refreshed by using that integer value as filter (where clause in the query (variable: qry here).</p>
<p>Since the rvwMain.LocalReport.DataSources is a collection the report implicitly takes the first added source as the source to refresh the report in subsequent button clicks.</p>
<p>To resolve this issue I just cleared the DataSources  collection of the LocalReport to get the desired result.<br />
Here is how to do it.</p>
<p> rvwMain.LocalReport.DataSources.Clear();<br />
rvwMain.LocalReport.DataSources.Add(&#8230;);</p>
<p>Just thought share it with everyone hoping that it might help the readers.</p>
<p>Thanks,<br />
Kritul</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Ed Crane</title>
		<link>http://arcanecode.com/2009/02/09/using-a-local-reporting-services-2008-report-with-an-adonet-data-set/#comment-28929</link>
		<dc:creator><![CDATA[Ed Crane]]></dc:creator>
		<pubDate>Sun, 30 Jan 2011 16:12:29 +0000</pubDate>
		<guid isPermaLink="false">http://arcanecode.wordpress.com/2009/02/09/using-a-local-reporting-services-2008-report-with-an-adonet-data-set/#comment-28929</guid>
		<description><![CDATA[Whoa, the reply mechanism doesn&#039;t seem to like angle brackets.  It butchered the following:

&quot;Depending on what sections the user wants to see, I cut out the unwanted sections and adjust the elements based on the cumulative elements. Be careful: the report designer usually removes the element for the top-most control (when it’s located at position 0,0) and the element for the bottom-most control.&quot;

It should have been (with angle brackets around Top and Height):

&quot;Depending on what sections the user wants to see, I cut out the unwanted sections and adjust the Top elements based on the cumulative Height elements. Be careful: the report designer usually removes the Top element for the top-most control (when it’s located at position 0,0) and the Height element for the bottom-most control.&quot;

Also, set the BorderStyle to None for the rectangle controls (report sections).]]></description>
		<content:encoded><![CDATA[<p>Whoa, the reply mechanism doesn&#8217;t seem to like angle brackets.  It butchered the following:</p>
<p>&#8220;Depending on what sections the user wants to see, I cut out the unwanted sections and adjust the elements based on the cumulative elements. Be careful: the report designer usually removes the element for the top-most control (when it’s located at position 0,0) and the element for the bottom-most control.&#8221;</p>
<p>It should have been (with angle brackets around Top and Height):</p>
<p>&#8220;Depending on what sections the user wants to see, I cut out the unwanted sections and adjust the Top elements based on the cumulative Height elements. Be careful: the report designer usually removes the Top element for the top-most control (when it’s located at position 0,0) and the Height element for the bottom-most control.&#8221;</p>
<p>Also, set the BorderStyle to None for the rectangle controls (report sections).</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Ed Crane</title>
		<link>http://arcanecode.com/2009/02/09/using-a-local-reporting-services-2008-report-with-an-adonet-data-set/#comment-28928</link>
		<dc:creator><![CDATA[Ed Crane]]></dc:creator>
		<pubDate>Sun, 30 Jan 2011 16:04:49 +0000</pubDate>
		<guid isPermaLink="false">http://arcanecode.wordpress.com/2009/02/09/using-a-local-reporting-services-2008-report-with-an-adonet-data-set/#comment-28928</guid>
		<description><![CDATA[Great starter article.  I just wanted to add a few things that might be helpful to folks wanting to do more advanced reports.

When you have multiple datasets(really just tables), you need to be able to distinguish fields from them.  With tables/matrices/lists there is a property DataSetName that you can set to the name of your dataset.  Be careful, the Report Designed sometimes obliterates this property when you add new datasets.  For textboxes, you have to use the First function where the first argument is the Fields!.Value and the second argument is the name of the dataset, e.g., =First(Fields!City.Value, &quot;VendorList_Vendors&quot;).

When you want to have dynamic control values in the header/footer regions, you can&#039;t reference dataset fields directly.  Most folks put secondary controls in the report body, tie them to the dataset fields, hide them and then tie the header/footer controls to the hidden ones in the body.

That&#039;s sort of sloppy and I&#039;ve heard it doesn&#039;t always work properly.  A better way is to directly manipulate the xml in the rdl/rdlc files and then calling the the LoadReportDefinition method like so: b.	viewer.LocalReport.LoadReportDefinition(new MemoryStream( System.Text.ASCIIEncoding.ASCII.GetBytes(xDoc.InnerXml))); where xDoc is an XmlDocument object with the modified rdlc xml.

When it comes to dynamic images in the the header/footer, a good way to achieve this is to add dummy embedded images to the report and point your header/footer image controls to the embedded images.  Once again, you modify the value of the embedded images in the rdlc xml prior to loading the report definition in the viewer.  Here&#039;s a method:

        public void SetHeaderImage(XmlDocument xDoc, string name, byte[] imgData, string format)
        {
            XmlElement elem = null;
            XmlNode img = SelectSingleNode(xDoc.ChildNodes[1], &quot;//Report/EmbeddedImages/EmbeddedImage[@Name=&#039;&quot; + name + &quot;&#039;]&quot;);
            if (img != null)
            {
                elem = (XmlElement)SelectSingleNode(img, &quot;./MIMEType&quot;);
                elem.InnerText = format;
                elem = (XmlElement)SelectSingleNode(img, &quot;./ImageData&quot;);
                elem.InnerText = Convert.ToBase64String(imgData);
            }
        }

and here&#039;s a helper method for selecting the right node:

        public XmlNode SelectSingleNode(XmlNode start, string path)
        {
            XmlNamespaceManager nsmgr = new XmlNamespaceManager(start.OwnerDocument.NameTable);
            nsmgr.AddNamespace(&quot;rptDef&quot;, &quot;http://schemas.microsoft.com/sqlserver/reporting/2005/01/reportdefinition&quot;);
            if (path.StartsWith(&quot;//&quot;))
                path = &quot;/&quot; + path.Substring(1).Replace(&quot;/&quot;, &quot;/rptDef:&quot;);
            else if (path.StartsWith(&quot;.//&quot;))
                path = &quot;./&quot; + path.Substring(2).Replace(&quot;/&quot;, &quot;/rptDef:&quot;);
            else
                path = path.Replace(&quot;/&quot;, &quot;/rptDef:&quot;);

            XmlNode node = start.SelectSingleNode(path, nsmgr);
            return node;
        }

Now you can have truly dynamic headers/footers.

For optional report sections, many folks use subreports, but I&#039;ve heard that can be slow.  Instead, I put all of my report sections inside Rectangle controls in the report body and manipulate the xml once again.  Depending on what sections the user wants to see, I cut out the unwanted sections and adjust the  elements based on the cumulative  elements.  Be careful: the report designer usually removes the  element for the top-most control (when it&#039;s located at position 0,0) and the  element for the bottom-most control.

I hope this helps out some folks who want to do some cool stuff with client-side RS reporting.

Cheers!]]></description>
		<content:encoded><![CDATA[<p>Great starter article.  I just wanted to add a few things that might be helpful to folks wanting to do more advanced reports.</p>
<p>When you have multiple datasets(really just tables), you need to be able to distinguish fields from them.  With tables/matrices/lists there is a property DataSetName that you can set to the name of your dataset.  Be careful, the Report Designed sometimes obliterates this property when you add new datasets.  For textboxes, you have to use the First function where the first argument is the Fields!.Value and the second argument is the name of the dataset, e.g., =First(Fields!City.Value, &#8220;VendorList_Vendors&#8221;).</p>
<p>When you want to have dynamic control values in the header/footer regions, you can&#8217;t reference dataset fields directly.  Most folks put secondary controls in the report body, tie them to the dataset fields, hide them and then tie the header/footer controls to the hidden ones in the body.</p>
<p>That&#8217;s sort of sloppy and I&#8217;ve heard it doesn&#8217;t always work properly.  A better way is to directly manipulate the xml in the rdl/rdlc files and then calling the the LoadReportDefinition method like so: b.	viewer.LocalReport.LoadReportDefinition(new MemoryStream( System.Text.ASCIIEncoding.ASCII.GetBytes(xDoc.InnerXml))); where xDoc is an XmlDocument object with the modified rdlc xml.</p>
<p>When it comes to dynamic images in the the header/footer, a good way to achieve this is to add dummy embedded images to the report and point your header/footer image controls to the embedded images.  Once again, you modify the value of the embedded images in the rdlc xml prior to loading the report definition in the viewer.  Here&#8217;s a method:</p>
<p>        public void SetHeaderImage(XmlDocument xDoc, string name, byte[] imgData, string format)<br />
        {<br />
            XmlElement elem = null;<br />
            XmlNode img = SelectSingleNode(xDoc.ChildNodes[1], &#8220;//Report/EmbeddedImages/EmbeddedImage[@Name='" + name + "']&#8220;);<br />
            if (img != null)<br />
            {<br />
                elem = (XmlElement)SelectSingleNode(img, &#8220;./MIMEType&#8221;);<br />
                elem.InnerText = format;<br />
                elem = (XmlElement)SelectSingleNode(img, &#8220;./ImageData&#8221;);<br />
                elem.InnerText = Convert.ToBase64String(imgData);<br />
            }<br />
        }</p>
<p>and here&#8217;s a helper method for selecting the right node:</p>
<p>        public XmlNode SelectSingleNode(XmlNode start, string path)<br />
        {<br />
            XmlNamespaceManager nsmgr = new XmlNamespaceManager(start.OwnerDocument.NameTable);<br />
            nsmgr.AddNamespace(&#8220;rptDef&#8221;, &#8220;http://schemas.microsoft.com/sqlserver/reporting/2005/01/reportdefinition&#8221;);<br />
            if (path.StartsWith(&#8220;//&#8221;))<br />
                path = &#8220;/&#8221; + path.Substring(1).Replace(&#8220;/&#8221;, &#8220;/rptDef:&#8221;);<br />
            else if (path.StartsWith(&#8220;.//&#8221;))<br />
                path = &#8220;./&#8221; + path.Substring(2).Replace(&#8220;/&#8221;, &#8220;/rptDef:&#8221;);<br />
            else<br />
                path = path.Replace(&#8220;/&#8221;, &#8220;/rptDef:&#8221;);</p>
<p>            XmlNode node = start.SelectSingleNode(path, nsmgr);<br />
            return node;<br />
        }</p>
<p>Now you can have truly dynamic headers/footers.</p>
<p>For optional report sections, many folks use subreports, but I&#8217;ve heard that can be slow.  Instead, I put all of my report sections inside Rectangle controls in the report body and manipulate the xml once again.  Depending on what sections the user wants to see, I cut out the unwanted sections and adjust the  elements based on the cumulative  elements.  Be careful: the report designer usually removes the  element for the top-most control (when it&#8217;s located at position 0,0) and the  element for the bottom-most control.</p>
<p>I hope this helps out some folks who want to do some cool stuff with client-side RS reporting.</p>
<p>Cheers!</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: James</title>
		<link>http://arcanecode.com/2009/02/09/using-a-local-reporting-services-2008-report-with-an-adonet-data-set/#comment-27511</link>
		<dc:creator><![CDATA[James]]></dc:creator>
		<pubDate>Fri, 19 Feb 2010 12:22:38 +0000</pubDate>
		<guid isPermaLink="false">http://arcanecode.wordpress.com/2009/02/09/using-a-local-reporting-services-2008-report-with-an-adonet-data-set/#comment-27511</guid>
		<description><![CDATA[Thanks! I&#039;ve been looking for a simple way to do reporting for ages. All the examples are to do with running reporting services, rather than this local mode.

Now for a leisurely afternoon creating stored procedures and report templates, rather than a frustrated afternoon trying to understand the MSDN :-)]]></description>
		<content:encoded><![CDATA[<p>Thanks! I&#8217;ve been looking for a simple way to do reporting for ages. All the examples are to do with running reporting services, rather than this local mode.</p>
<p>Now for a leisurely afternoon creating stored procedures and report templates, rather than a frustrated afternoon trying to understand the MSDN <img src='http://s0.wp.com/wp-includes/images/smilies/icon_smile.gif' alt=':-)' class='wp-smiley' /> </p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Manu</title>
		<link>http://arcanecode.com/2009/02/09/using-a-local-reporting-services-2008-report-with-an-adonet-data-set/#comment-26759</link>
		<dc:creator><![CDATA[Manu]]></dc:creator>
		<pubDate>Thu, 28 May 2009 16:23:04 +0000</pubDate>
		<guid isPermaLink="false">http://arcanecode.wordpress.com/2009/02/09/using-a-local-reporting-services-2008-report-with-an-adonet-data-set/#comment-26759</guid>
		<description><![CDATA[Buenas,

¿¿podrías poner la solución??

Gracias.]]></description>
		<content:encoded><![CDATA[<p>Buenas,</p>
<p>¿¿podrías poner la solución??</p>
<p>Gracias.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Esteban Arrubla</title>
		<link>http://arcanecode.com/2009/02/09/using-a-local-reporting-services-2008-report-with-an-adonet-data-set/#comment-26501</link>
		<dc:creator><![CDATA[Esteban Arrubla]]></dc:creator>
		<pubDate>Fri, 06 Mar 2009 21:23:39 +0000</pubDate>
		<guid isPermaLink="false">http://arcanecode.wordpress.com/2009/02/09/using-a-local-reporting-services-2008-report-with-an-adonet-data-set/#comment-26501</guid>
		<description><![CDATA[Ya lo solucioné.....muchas gracias ;)]]></description>
		<content:encoded><![CDATA[<p>Ya lo solucioné&#8230;..muchas gracias <img src='http://s1.wp.com/wp-includes/images/smilies/icon_wink.gif' alt=';)' class='wp-smiley' /> </p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Esteban Arrubla</title>
		<link>http://arcanecode.com/2009/02/09/using-a-local-reporting-services-2008-report-with-an-adonet-data-set/#comment-26500</link>
		<dc:creator><![CDATA[Esteban Arrubla]]></dc:creator>
		<pubDate>Fri, 06 Mar 2009 21:02:42 +0000</pubDate>
		<guid isPermaLink="false">http://arcanecode.wordpress.com/2009/02/09/using-a-local-reporting-services-2008-report-with-an-adonet-data-set/#comment-26500</guid>
		<description><![CDATA[Se me había olvidado....muchas gracias por el ejemplo, está muy bueno...]]></description>
		<content:encoded><![CDATA[<p>Se me había olvidado&#8230;.muchas gracias por el ejemplo, está muy bueno&#8230;</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Esteban Arrubla</title>
		<link>http://arcanecode.com/2009/02/09/using-a-local-reporting-services-2008-report-with-an-adonet-data-set/#comment-26499</link>
		<dc:creator><![CDATA[Esteban Arrubla]]></dc:creator>
		<pubDate>Fri, 06 Mar 2009 21:02:08 +0000</pubDate>
		<guid isPermaLink="false">http://arcanecode.wordpress.com/2009/02/09/using-a-local-reporting-services-2008-report-with-an-adonet-data-set/#comment-26499</guid>
		<description><![CDATA[Hi, I don&#039;t speak in english but I&#039;d like to know something...I tried to do this example, but I have a trouble...When I do click on the Button DataSet, I have a ErrorMessage that say me this: &quot;Se ha producido un error durante el procesamiento local de informes.
No se ha especificado la definición del informe &#039;ReportingServicesLocal.VendorList.rdlc&#039; &quot;....what can I do?....please, I&#039;ll be waiting for an ans...Thanks...]]></description>
		<content:encoded><![CDATA[<p>Hi, I don&#8217;t speak in english but I&#8217;d like to know something&#8230;I tried to do this example, but I have a trouble&#8230;When I do click on the Button DataSet, I have a ErrorMessage that say me this: &#8220;Se ha producido un error durante el procesamiento local de informes.<br />
No se ha especificado la definición del informe &#8216;ReportingServicesLocal.VendorList.rdlc&#8217; &#8220;&#8230;.what can I do?&#8230;.please, I&#8217;ll be waiting for an ans&#8230;Thanks&#8230;</p>
]]></content:encoded>
	</item>
</channel>
</rss>

