Programmatically Export from SQL Reporting Services in C#
Here is the sample code for rendering SQL Reporting Services Report to desired file types (PDF, XLS etc.): private void generateReport( string _ReportName, string _period1, string _period2, string _division, string _department, string _employee) { try { string _ReportServer = System.Configuration. ConfigurationManager .ConnectionStrings[ "ReportServer" ].ToString(); string _ReportPath = System.Configuration. ConfigurationManager .ConnectionStrings[ "ReportPath" ].ToString(); ReportViewer1.ProcessingMode = ProcessingMode .Remote; Uri ReportURI = new Uri (_ReportServer); this .ReportViewer1.ServerReport.ReportServerUrl = ReportURI; this .ReportViewer1.ServerReport.ReportPath = _ReportPath + _ReportName; int repParams = 2; switch (_ReportName) { case "/ExpenseReportByDivision" : repParams = 2; break ; case "/ExpenseReportByDepartment" : repParams = 3; break ; case "/ExpenseReportByEmployee" : ...
Comments
Post a Comment