I use this dll for compression .It’s working fine. But when i export a report in world/Excel it’s showing this error

“Server cannot append header after HTTP headers have been sent. ”

My Code :

public static void ExportToWord(GridView gvReport,Panel tdReportInfo,string reportName)
{
try
{
reportName = reportName + “.doc”;
HttpContext.Current.Response.Clear();
HttpContext.Current.Response.Buffer = true;
HttpContext.Current.Response.ClearContent();
HttpContext.Current.Response.ClearHeaders();
HttpContext.Current.Response.AddHeader(“content-disposition”,
“attachment;filename=” + reportName + “”);
HttpContext.Current.Response.Charset = “”;
HttpContext.Current.Response.ContentType = “application/vnd.ms-word “;
StringWriter sw = new StringWriter();
HtmlTextWriter hw = new HtmlTextWriter(sw);
tdReportInfo.RenderControl(hw);
gvReport.RenderControl(hw);
HttpContext.Current.Response.Output.Write(sw.ToString());
HttpContext.Current.Response.Flush();
HttpContext.Current.Response.End();
}
catch (Exception ex)
{
ReallySimpleLog.WriteLog(ex);

}
}

Any suggestion please ?