Welcome to the new platform of Programmer's Heaven! We apologize for the inconvenience caused, if you visited us from a broken link of the previous version. The main reason to move to a new platform is to provide more effective and collaborative experience to you all. Please feel free to experience the new platform and use its exciting features. Contact us for any issue that you need to get clarified. We are more than happy to help you.
Cannot redirect after http headers have been sent asp.net
i have trying to develop an application in which i have to export a report to pdf file.
i use crystal reports for that.
i also have to stream that report to client machine and do not have to store that on server.
this happens on a button's click event which is as follows.
protected void Button1_Click(object sender, EventArgs e)
ReportDocument StReport = new ReportDocument();
string reportPath = Server.MapPath(@"~Report.rpt");
crExportOptions = StReport.ExportOptions;
crExportOptions.ExportFormatType = ExportFormatType.PortableDocFormat;
MemoryStream ms = (MemoryStream)StReport.ExportToStream(ExportFormatType.PortableDocFormat);
i get the error i mentioned in the subject of this post.
kindly help me in this matter and show me the way forward.
thanks in advance.
0 · ·