<?xml version="1.0" encoding="UTF-8" ?>
<?xml-stylesheet type="text/xsl" href="http://weblogs.asp.net/utility/FeedStylesheets/rss.xsl" media="screen"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" xmlns:wfw="http://wellformedweb.org/CommentAPI/"><channel><title>Exporting a SQL Server Reporting Services 2005 Report Directly to PDF or Excel</title><link>http://weblogs.asp.net/srkirkland/archive/2007/10/29/exporting-a-sql-server-reporting-services-2005-report-directly-to-pdf-or-excel.aspx</link><description>Exporting a SQL Server Reporting Services 2005 (SSRS) Report Directly to PDF/Excel is a handy way of generating high quality reports without being stuck to using the ReportViewer interface. Sometimes the ReportViewer interface is an unnecessary step,</description><dc:language>en</dc:language><generator>CommunityServer 2007 SP1 (Build: 20510.895)</generator><item><title>re: Exporting a SQL Server Reporting Services 2005 Report Directly to PDF or Excel</title><link>http://weblogs.asp.net/srkirkland/archive/2007/10/29/exporting-a-sql-server-reporting-services-2005-report-directly-to-pdf-or-excel.aspx#7247556</link><pubDate>Thu, 05 Nov 2009 05:36:43 GMT</pubDate><guid isPermaLink="false">c06e2b9d-981a-45b4-a55f-ab0d8bbfdc1c:7247556</guid><dc:creator>Ali Adravi</dc:creator><author>Ali Adravi</author><description>&lt;p&gt;Is that possible to send the report in mail as an atachment from SQL?&lt;/p&gt;
&lt;p&gt;I have a report I want to mail it through a cheduling by creating a Job and chedule the report, is this possible?&lt;/p&gt;
&lt;p&gt;If yes, could please send me the code or link.&lt;/p&gt;
&lt;p&gt;Ali Adravi&lt;/p&gt;
&lt;p&gt;Fakhruddin.ali@metaoption.com&lt;/p&gt;
&lt;img src="http://weblogs.asp.net/aggbug.aspx?PostID=7247556" width="1" height="1"&gt;</description></item><item><title>re: Exporting a SQL Server Reporting Services 2005 Report Directly to PDF or Excel</title><link>http://weblogs.asp.net/srkirkland/archive/2007/10/29/exporting-a-sql-server-reporting-services-2005-report-directly-to-pdf-or-excel.aspx#7183259</link><pubDate>Thu, 27 Aug 2009 19:48:39 GMT</pubDate><guid isPermaLink="false">c06e2b9d-981a-45b4-a55f-ab0d8bbfdc1c:7183259</guid><dc:creator>Doug</dc:creator><author>Doug</author><description>&lt;p&gt; &amp;nbsp;Dim rview As New Microsoft.Reporting.WebForms.ReportViewer()&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp;'Web Address of your report server (ex: http:'rserver/reportserver)&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp;' &amp;nbsp;I used AppSettingsReader instead of WebConfigurationManager class&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp;Dim apr As New AppSettingsReader()&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp;rview.ServerReport.ReportServerUrl = New Uri(apr.GetValue(&amp;quot;ReportServer&amp;quot;, GetType(String)))&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp;Dim paramList As New System.Collections.Generic.List(Of Microsoft.Reporting.WebForms.ReportParameter)&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp;' set your parameters&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp;paramList.Add(New Microsoft.Reporting.WebForms.ReportParameter(&amp;quot;Param1&amp;quot;, &amp;quot;Value1&amp;quot;))&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp;paramList.Add(New Microsoft.Reporting.WebForms.ReportParameter(&amp;quot;Param2&amp;quot;, &amp;quot;Value2&amp;quot;))&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp;' set the name of the reportPath&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp;rview.ServerReport.ReportPath = &amp;quot;/ReportFolder/ReportName&amp;quot;&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp;rview.ServerReport.SetParameters(paramList)&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp;Dim mimeType As String = Nothing&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp;Dim encoding As String = Nothing&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp;Dim extension As String = Nothing&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp;Dim deviceInfo As String = Nothing&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp;Dim streamids As String() = Nothing&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp;Dim warnings As Microsoft.Reporting.WebForms.Warning() = Nothing&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp;Dim format As String = &amp;quot;PDF&amp;quot; &amp;nbsp; &amp;nbsp;'Desired format goes here (PDF, Excel, or Image) &lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp;deviceInfo = &amp;quot;&amp;lt;DeviceInfo&amp;gt;&amp;lt;SimplePageHeaders&amp;gt;True&amp;lt;/SimplePageHeaders&amp;gt;&amp;lt;/DeviceInfo&amp;gt;&amp;quot;&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp;Dim bytes As Byte() = rview.ServerReport.Render(format, deviceInfo, mimeType, encoding, extension, streamids, warnings)&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp;Response.Clear()&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp;If format = &amp;quot;PDF&amp;quot; Then&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp;Response.ContentType = &amp;quot;application/pdf&amp;quot;&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp;Response.AddHeader(&amp;quot;Content-disposition&amp;quot;, &amp;quot;filename=output.pdf&amp;quot;)&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp;ElseIf format = &amp;quot;Excel&amp;quot; Then&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp;Response.ContentType = &amp;quot;application/excel&amp;quot;&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp;Response.AddHeader(&amp;quot;Content-disposition&amp;quot;, &amp;quot;filename=output.xls&amp;quot;)&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp;End If&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp;Response.OutputStream.Write(bytes, 0, bytes.Length)&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp;Response.OutputStream.Flush()&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp;Response.OutputStream.Close()&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp;Response.Flush()&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp;Response.Close()&lt;/p&gt;
&lt;img src="http://weblogs.asp.net/aggbug.aspx?PostID=7183259" width="1" height="1"&gt;</description></item><item><title>re: Exporting a SQL Server Reporting Services 2005 Report Directly to PDF or Excel</title><link>http://weblogs.asp.net/srkirkland/archive/2007/10/29/exporting-a-sql-server-reporting-services-2005-report-directly-to-pdf-or-excel.aspx#7171485</link><pubDate>Mon, 17 Aug 2009 18:39:31 GMT</pubDate><guid isPermaLink="false">c06e2b9d-981a-45b4-a55f-ab0d8bbfdc1c:7171485</guid><dc:creator>Luis</dc:creator><author>Luis</author><description>&lt;p&gt;Does anyone have this code on visual basic??&lt;/p&gt;
&lt;img src="http://weblogs.asp.net/aggbug.aspx?PostID=7171485" width="1" height="1"&gt;</description></item><item><title>re: Exporting a SQL Server Reporting Services 2005 Report Directly to PDF or Excel</title><link>http://weblogs.asp.net/srkirkland/archive/2007/10/29/exporting-a-sql-server-reporting-services-2005-report-directly-to-pdf-or-excel.aspx#7134010</link><pubDate>Thu, 25 Jun 2009 12:41:54 GMT</pubDate><guid isPermaLink="false">c06e2b9d-981a-45b4-a55f-ab0d8bbfdc1c:7134010</guid><dc:creator>Bill</dc:creator><author>Bill</author><description>&lt;p&gt;Has anyone tested this code using SSRS 2000?&lt;/p&gt;
&lt;img src="http://weblogs.asp.net/aggbug.aspx?PostID=7134010" width="1" height="1"&gt;</description></item><item><title>re: Exporting a SQL Server Reporting Services 2005 Report Directly to PDF or Excel</title><link>http://weblogs.asp.net/srkirkland/archive/2007/10/29/exporting-a-sql-server-reporting-services-2005-report-directly-to-pdf-or-excel.aspx#7127860</link><pubDate>Wed, 17 Jun 2009 15:39:37 GMT</pubDate><guid isPermaLink="false">c06e2b9d-981a-45b4-a55f-ab0d8bbfdc1c:7127860</guid><dc:creator>George</dc:creator><author>George</author><description>&lt;p&gt;I want to export SRS 2005 reports exactly into Excel 2007. Because the report that I generate contains much more information than it is possible to fit in Excel 2003. can anyone help me?.. thanks&lt;/p&gt;
&lt;img src="http://weblogs.asp.net/aggbug.aspx?PostID=7127860" width="1" height="1"&gt;</description></item><item><title>re: Exporting a SQL Server Reporting Services 2005 Report Directly to PDF or Excel</title><link>http://weblogs.asp.net/srkirkland/archive/2007/10/29/exporting-a-sql-server-reporting-services-2005-report-directly-to-pdf-or-excel.aspx#7099687</link><pubDate>Thu, 28 May 2009 07:34:27 GMT</pubDate><guid isPermaLink="false">c06e2b9d-981a-45b4-a55f-ab0d8bbfdc1c:7099687</guid><dc:creator>Admir</dc:creator><author>Admir</author><description>&lt;p&gt;Thanx a lot&lt;/p&gt;
&lt;p&gt;Works like charm&lt;/p&gt;
&lt;p&gt;Any Idea how to this exported report attach to e mail and send &lt;/p&gt;
&lt;p&gt;to someone.&lt;/p&gt;
&lt;img src="http://weblogs.asp.net/aggbug.aspx?PostID=7099687" width="1" height="1"&gt;</description></item><item><title>re: Exporting a SQL Server Reporting Services 2005 Report Directly to PDF or Excel</title><link>http://weblogs.asp.net/srkirkland/archive/2007/10/29/exporting-a-sql-server-reporting-services-2005-report-directly-to-pdf-or-excel.aspx#7076001</link><pubDate>Thu, 07 May 2009 17:23:03 GMT</pubDate><guid isPermaLink="false">c06e2b9d-981a-45b4-a55f-ab0d8bbfdc1c:7076001</guid><dc:creator>Gris</dc:creator><author>Gris</author><description>&lt;p&gt;Hola &lt;/p&gt;
&lt;p&gt;para este mensaje&lt;/p&gt;
&lt;p&gt;Hi, &lt;/p&gt;
&lt;p&gt;I want to export to PDF an report with params, Do you have any idea?&lt;/p&gt;
&lt;p&gt;sorry, but I tried it, and i can't&lt;/p&gt;
&lt;p&gt;Thank.&lt;/p&gt;
&lt;p&gt;----------------------------------&lt;/p&gt;
&lt;p&gt;Ejemplo:&lt;/p&gt;
&lt;p&gt;Donde WRCustomers es el nombre del webservice&lt;/p&gt;
&lt;p&gt;Dim RSGuardar As New WRCustomers.ReportExecutionService&lt;/p&gt;
&lt;p&gt;Dim WRParam(0) As WRCustomers.ParameterValue&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;WRParam(0) = New WRCustomers.ParameterValue()&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;WRParam(0).Name = &amp;quot;Estato&amp;quot;&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;WRParam(0).Value = &amp;quot;6578&amp;quot;&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;' Cargo el report.&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;RSGuardar.LoadReport(Me.ReportViewer1.ServerReport.ReportPath, historyID)&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;RSGuardar.SetExecutionParameters(WRParam, &amp;quot;es-mx&amp;quot;)&lt;/p&gt;
&lt;img src="http://weblogs.asp.net/aggbug.aspx?PostID=7076001" width="1" height="1"&gt;</description></item><item><title>re: Exporting a SQL Server Reporting Services 2005 Report Directly to PDF or Excel</title><link>http://weblogs.asp.net/srkirkland/archive/2007/10/29/exporting-a-sql-server-reporting-services-2005-report-directly-to-pdf-or-excel.aspx#7075954</link><pubDate>Thu, 07 May 2009 17:00:17 GMT</pubDate><guid isPermaLink="false">c06e2b9d-981a-45b4-a55f-ab0d8bbfdc1c:7075954</guid><dc:creator>Gris</dc:creator><author>Gris</author><description>&lt;p&gt;Hi, &lt;/p&gt;
&lt;p&gt;I want to export to PDF an report with params, Do you have any idea?&lt;/p&gt;
&lt;p&gt;sorry, but I tried it, and i can't&lt;/p&gt;
&lt;p&gt;Thank.&lt;/p&gt;
&lt;img src="http://weblogs.asp.net/aggbug.aspx?PostID=7075954" width="1" height="1"&gt;</description></item><item><title>re: Exporting a SQL Server Reporting Services 2005 Report Directly to PDF or Excel</title><link>http://weblogs.asp.net/srkirkland/archive/2007/10/29/exporting-a-sql-server-reporting-services-2005-report-directly-to-pdf-or-excel.aspx#7075939</link><pubDate>Thu, 07 May 2009 16:55:17 GMT</pubDate><guid isPermaLink="false">c06e2b9d-981a-45b4-a55f-ab0d8bbfdc1c:7075939</guid><dc:creator>Gris</dc:creator><author>Gris</author><description>&lt;p&gt;Hi, &lt;/p&gt;
&lt;p&gt;I want to export to PDF an report with params, Do you have any idea?&lt;/p&gt;
&lt;p&gt;sorry, but I tried it, and i can't&lt;/p&gt;
&lt;p&gt;Thank.&lt;/p&gt;
&lt;img src="http://weblogs.asp.net/aggbug.aspx?PostID=7075939" width="1" height="1"&gt;</description></item><item><title>re: Exporting a SQL Server Reporting Services 2005 Report Directly to PDF or Excel</title><link>http://weblogs.asp.net/srkirkland/archive/2007/10/29/exporting-a-sql-server-reporting-services-2005-report-directly-to-pdf-or-excel.aspx#7074808</link><pubDate>Wed, 06 May 2009 13:47:31 GMT</pubDate><guid isPermaLink="false">c06e2b9d-981a-45b4-a55f-ab0d8bbfdc1c:7074808</guid><dc:creator>Christopher Smith</dc:creator><author>Christopher Smith</author><description>&lt;p&gt;The above code works great, however is there a way to export multiple reports to an Excel file, with each report having it's own tab?&lt;/p&gt;
&lt;p&gt;I want the user to be able to select one or more reports, hit a button and the result is one Excel file containing all the reports run.&lt;/p&gt;
&lt;img src="http://weblogs.asp.net/aggbug.aspx?PostID=7074808" width="1" height="1"&gt;</description></item></channel></rss>