Reporting Services to display in pdf

Last Reply on Jan 09, 2014 02:35 AM By Pradip

Posted on Jan 09, 2014 02:32 AM

I am little bit confused here, reporting services has an option to import data to Excel, Pdf e.t.c

But for some reason the user want it to display in pdf, when he/she opens it must ask to save or open the pfd file, i have design the report and its working perfect in SQL Server Reporting Services. Here is the code below:

if (!IsPostBack)
{
ReportViewer1.ServerReport.ReportServerUrl = new System.Uri("https://ServerName/ReportServer");
ReportViewer1.ServerReport.ReportPath = "/ReportFolder/MonthlyReport";

Microsoft.Reporting.WebForms.ReportParameter[] Param = new Microsoft.Reporting.WebForms.ReportParameter[3];
Param[0] = new ReportParameter("startAt", Session["startAt"].ToString());
Param[1] = new ReportParameter("endAt", Session["endAt"].ToString());
Param[2] = new ReportParameter("StaffID", Session["ID"].ToString());
ReportViewer1.ProcessingMode = Microsoft.Reporting.WebForms.ProcessingMode.Remote;
ReportViewer1.ShowParameterPrompts = false;
ReportViewer1.ServerReport.SetParameters(Param);
ReportViewer1.ServerReport.Refresh();

}

My question is; from this code, how do i display the report in Pdf, where it will ask a user to save/open a pdf file? 

And if i may ask, what are the advantages or disadavantes of opening a report in pdf file instead of using Reporting Services?

 

Thanks in advance


I agree, here is the link: https://www.e-iceblue.com/Introduce/spire-office-for-net-free.html