Cannot redirect after http headers have been sent

hi friends,

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);


ExportOptions crExportOptions;

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.

i even tried javascript code which is commented in the listing above but that also failed.

kindly help me in this matter and show me the way forward.

thanks in advance.

Sign In or Register to comment.

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!