IASSettings oAppSettings = new IASSettings(); > > string URL = oAppSettings.ReportServerURL + "?/SIAS Reports/Receipt&rs:Command=Render&rs:Format=PDF&rc:Parameters=false&ReceiptNumber=" + this.oReceipt.Entity.ReceiptNumber; > > System.Net.HttpWebRequest Req = (System.Net.HttpWebRequest)System.Net.WebRequest.Create(URL); > Req.Credentials = System.Net.CredentialCache.DefaultCredentials; > Req.Method = "GET"; > > //Specify the path for saving. > > string path = oAppSettings.ReceiptFolder + this.oReceipt.Entity.ReceiptNumber + @".pdf"; > > System.Net.WebResponse objResponse = Req.GetResponse(); > System.IO.FileStream fs = new System.IO.FileStream(path, System.IO.FileMode.Create); > System.IO.Stream stream = objResponse.GetResponseStream(); > byte[] buf = new byte[1024]; > int len = stream.Read(buf, 0, 1024); > while (len > 0) > { > fs.Write(buf, 0, len); > len = stream.Read(buf, 0, 1024); > } > stream.Close(); > fs.Close();>