ReportDocument rptDoc = new ReportDocument(); rptDoc.Load(Server.MapPath("/Reports/RPT/" + RepName)); rptDoc.Refresh(); rptDoc.SetDataSource(dtReportData); CrystalReportViewer1.ReportSource = rptDoc; BinaryReader stream = new BinaryReader(rptDoc.ExportToStream(CrystalDecisions.Shared.ExportFormatType.PortableDocFormat)); Response.ClearContent(); Response.ClearHeaders(); Response.ContentType = "application/pdf"; Response.AddHeader("content-disposition", "attachment; filename=" + ReportName + ".pdf"); Response.AddHeader("content-length", stream.BaseStream.Length.ToString()); Response.BinaryWrite(stream.ReadBytes(Convert.ToInt32(stream.BaseStream.Length))); Response.Flush(); Response.Close();
crystalreport1 objReport=new crystalreport1(); crystalreportviewer1.reportsource=objReport;
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)