using System; using System.IO; using System.Web.Services.Protocols; using myNamespace.MyReferenceName; class Sample { static void Main(string[] args) { ReportExecutionService rs = new ReportExecutionService(); rs.Credentials = System.Net.CredentialCache.DefaultCredentials; rs.Url = "http:myLocaladdress"; // Render arguments byte[] result = null; string reportPath = "/TEST"; string format = "PDF"; string historyID = null; string devInfo = @"<deviceinfo><toolbar>False</toolbar></deviceinfo>"; try { result = rs.Render(format, devInfo, out extension, out encoding, out mimeType, out warnings, out streamIDs); execInfo = rs.GetExecutionInfo(); Console.WriteLine("Execution date and time: {0}", execInfo.ExecutionDateTime); } catch (SoapException e) { Console.WriteLine(e.Detail.OuterXml); } // Write the contents of the report to an PDF file. try { Byte[] results = rsExec.Render(format, deviceInfo, out extension, out mimeType, out encoding, out warnings, out streamIDs); FileStream stream = File.OpenWrite("C:\\T.pdf"); stream.Write(result, 0, result.Length); Console.WriteLine("Result written to the file."); stream.Close(); } catch (Exception e) { Console.WriteLine(e.Message); } } }
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)