<rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:trackback="http://madskills.com/public/xml/rss/module/trackback/" xmlns:wfw="http://wellformedweb.org/CommentAPI/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" xmlns:copyright="http://blogs.law.harvard.edu/tech/rss" xmlns:image="http://purl.org/rss/1.0/modules/image/">
    <channel>
        <title>Reporting Services</title>
        <link>http://waynester.net/blog/category/27.aspx</link>
        <description>Microsoft SQL Server Reporting Services</description>
        <language>en-US</language>
        <copyright>Wayne Larimore</copyright>
        <managingEditor>wayne@waynester.net</managingEditor>
        <generator>Subtext Version 1.9.3.51</generator>
        <item>
            <title>Creating Snapshots Passing Parameters with Reporting Services And Controlling Report History</title>
            <link>http://waynester.net/blog/archive/2006/12/13/5292.aspx</link>
            <description>&lt;P&gt;&lt;FONT face=Verdana size=2&gt;In order to pass parameters to a snapshot report in Reporting Services 2005 via WSDL you must create a linked report first.&amp;nbsp; You can control the history a linked report keeps as well.&amp;nbsp; Here's a&amp;nbsp;code snippet&amp;nbsp;I used recently to accomplish this...&lt;/FONT&gt;&lt;/P&gt;&lt;FONT color=#0000ff&gt;
&lt;P&gt;&lt;FONT color=#008000 size=2&gt;''' Purpose:&lt;/FONT&gt;&lt;FONT color=#808080&gt;&lt;/P&gt;&lt;/FONT&gt;
&lt;P&gt;&lt;FONT color=#008000&gt;&lt;FONT size=2&gt;''' Handles&amp;nbsp;Creation Of Linked Reports in Microsoft SQL Server Reporting Services 2005&lt;/FONT&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT color=#008000&gt;&lt;FONT size=2&gt;''' required parameters:&lt;/FONT&gt;&lt;/P&gt;&lt;/FONT&gt;
&lt;P&gt;&lt;FONT size=2&gt;&lt;FONT color=#008000&gt;''' rs - &lt;/FONT&gt;&lt;FONT color=#808080&gt;&lt;PARAM name="rs"&gt;reporting services web reference&lt;/PARAM&gt;&lt;/P&gt;&lt;/FONT&gt;&lt;/FONT&gt;
&lt;P&gt;&lt;FONT size=2&gt;&lt;FONT color=#008000&gt;''' reportname - &lt;/FONT&gt;&lt;FONT color=#808080&gt;&lt;PARAM name="reportname"&gt;name of linked report&lt;/PARAM&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/P&gt;&lt;FONT color=#808080&gt;
&lt;P&gt;&lt;FONT size=2&gt;&lt;FONT color=#008000&gt;''' rp - &lt;/FONT&gt;&lt;FONT color=#808080&gt;&lt;PARAM name="rp"&gt;report path&lt;/PARAM&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/P&gt;&lt;FONT color=#808080&gt;
&lt;P&gt;&lt;FONT size=2&gt;&lt;FONT color=#008000&gt;''' rplr - &lt;/FONT&gt;&lt;FONT color=#808080&gt;&lt;PARAM name="rplr"&gt;report link path&lt;/PARAM&gt;&lt;/P&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;
&lt;P&gt;&lt;FONT size=2&gt;&lt;FONT color=#0000ff&gt;Private&lt;/FONT&gt; &lt;FONT color=#0000ff&gt;Sub&lt;/FONT&gt; CreateLinkedReport(&lt;FONT color=#0000ff&gt;ByRef&lt;/FONT&gt; rs &lt;FONT color=#0000ff&gt;As&lt;/FONT&gt; ReportingService2005, &lt;FONT color=#0000ff&gt;ByVal&lt;/FONT&gt; reportname &lt;FONT color=#0000ff&gt;As&lt;/FONT&gt; &lt;FONT color=#0000ff&gt;String&lt;/FONT&gt;, &lt;FONT color=#0000ff&gt;ByVal&lt;/FONT&gt; rp &lt;FONT color=#0000ff&gt;As&lt;/FONT&gt; &lt;FONT color=#0000ff&gt;String&lt;/FONT&gt;, &lt;FONT color=#0000ff&gt;ByVal&lt;/FONT&gt; rplr &lt;FONT color=#0000ff&gt;As&lt;/FONT&gt; &lt;FONT color=#0000ff&gt;String&lt;/FONT&gt;)&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT size=2&gt;&lt;FONT color=#0000ff&gt;Dim&lt;/FONT&gt; prop &lt;FONT color=#0000ff&gt;As&lt;/FONT&gt; &lt;FONT color=#0000ff&gt;New&lt;/FONT&gt; [Property]()&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT size=2&gt;prop.Name = &lt;FONT color=#800000&gt;"Description"&lt;/P&gt;&lt;/FONT&gt;&lt;/FONT&gt;
&lt;P&gt;&lt;FONT size=2&gt;prop.Value = &lt;FONT color=#800000&gt;"Linked Report for event code "&lt;/FONT&gt; &amp;amp; m_eventcd&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT size=2&gt;&lt;FONT color=#0000ff&gt;Dim&lt;/FONT&gt; parms &lt;FONT color=#0000ff&gt;As&lt;/FONT&gt; ReportParameter() = &lt;FONT color=#0000ff&gt;Nothing&lt;/P&gt;&lt;/FONT&gt;&lt;/FONT&gt;
&lt;P&gt;&lt;FONT size=2&gt;&lt;FONT color=#0000ff&gt;Dim&lt;/FONT&gt; reportParameterValues &lt;FONT color=#0000ff&gt;As&lt;/FONT&gt; &lt;FONT color=#0000ff&gt;New&lt;/FONT&gt; ArrayList&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT size=2&gt;&lt;FONT color=#0000ff&gt;Dim&lt;/FONT&gt; value &lt;FONT color=#0000ff&gt;As&lt;/FONT&gt; &lt;FONT color=#0000ff&gt;New&lt;/FONT&gt; ParameterValue&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT size=2&gt;value.Name = &lt;FONT color=#800000&gt;"EventCd"&lt;/P&gt;&lt;/FONT&gt;&lt;/FONT&gt;
&lt;P&gt;&lt;FONT size=2&gt;value.Value = m_eventcd&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT size=2&gt;value.Label = &lt;FONT color=#800000&gt;"EventCd"&lt;/P&gt;&lt;/FONT&gt;&lt;/FONT&gt;
&lt;P&gt;&lt;FONT size=2&gt;reportParameterValues.Add(value)&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT size=2&gt;parms = rs.GetReportParameters(rp &amp;amp; &lt;FONT color=#800000&gt;"/"&lt;/FONT&gt; &amp;amp; reportname, &lt;FONT color=#0000ff&gt;Nothing&lt;/FONT&gt;, &lt;FONT color=#0000ff&gt;True&lt;/FONT&gt;, reportParameterValues.ToArray(&lt;FONT color=#0000ff&gt;GetType&lt;/FONT&gt;(ParameterValue)), &lt;FONT color=#0000ff&gt;Nothing&lt;/FONT&gt;)&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT size=2&gt;&lt;FONT color=#0000ff&gt;Dim&lt;/FONT&gt; props(0) &lt;FONT color=#0000ff&gt;As&lt;/FONT&gt; [Property]&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT size=2&gt;props(0) = prop&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT color=#0000ff&gt;&lt;FONT size=2&gt;Try&lt;/FONT&gt;&lt;/P&gt;&lt;/FONT&gt;
&lt;P&gt;&lt;FONT size=2&gt;&amp;nbsp; rs.CreateLinkedReport(reportname &amp;amp; &lt;FONT color=#800000&gt;"-"&lt;/FONT&gt; &amp;amp; m_eventcd, _&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT size=2&gt;&amp;nbsp; rplr, _&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT size=2&gt;&amp;nbsp; rp &amp;amp; &lt;FONT color=#800000&gt;"/"&lt;/FONT&gt; &amp;amp; reportname, _&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT size=2&gt;&amp;nbsp; props)&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT size=2&gt;&amp;nbsp; rs.SetReportParameters(rplr &amp;amp; &lt;FONT color=#800000&gt;"/"&lt;/FONT&gt; &amp;amp; reportname &amp;amp; &lt;FONT color=#800000&gt;"-"&lt;/FONT&gt; &amp;amp; m_eventcd, parms)&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT size=2&gt;&amp;nbsp; rs.SetReportHistoryLimit(rplr &amp;amp; &lt;FONT color=#800000&gt;"/"&lt;/FONT&gt; &amp;amp; reportname &amp;amp; &lt;FONT color=#800000&gt;"-"&lt;/FONT&gt; &amp;amp; m_eventcd, &lt;FONT color=#0000ff&gt;False&lt;/FONT&gt;, 5)&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT size=2&gt;&lt;FONT color=#0000ff&gt;Catch&lt;/FONT&gt; ex &lt;FONT color=#0000ff&gt;As&lt;/FONT&gt; SoapException&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT size=2&gt;&amp;nbsp; ErrorMessageLabel.Text = &lt;FONT color=#800000&gt;"The creation of the linked report was not successful."&lt;/P&gt;&lt;/FONT&gt;&lt;/FONT&gt;
&lt;P&gt;&lt;FONT size=2&gt;&lt;FONT color=#0000ff&gt;End&lt;/FONT&gt; &lt;FONT color=#0000ff&gt;Try&lt;/P&gt;&lt;/FONT&gt;&lt;/FONT&gt;
&lt;P&gt;&lt;FONT size=1&gt;&lt;FONT size=2&gt;&lt;FONT color=#0000ff&gt;End&lt;/FONT&gt; &lt;FONT color=#0000ff&gt;Sub&lt;/P&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;img src="http://waynester.net/blog/aggbug/5292.aspx" width="1" height="1" /&gt;</description>
            <dc:creator>Wayne Larimore</dc:creator>
            <guid>http://waynester.net/blog/archive/2006/12/13/5292.aspx</guid>
            <pubDate>Wed, 13 Dec 2006 15:10:00 GMT</pubDate>
            <wfw:comment>http://waynester.net/blog/comments/5292.aspx</wfw:comment>
            <comments>http://waynester.net/blog/archive/2006/12/13/5292.aspx#feedback</comments>
            <wfw:commentRss>http://waynester.net/blog/comments/commentRss/5292.aspx</wfw:commentRss>
            <trackback:ping>http://waynester.net/blog/services/trackbacks/5292.aspx</trackback:ping>
        </item>
    </channel>
</rss>