locked
Export to Excel in all excel versions.... RRS feed

  • Question

  •  

    Below code works fine in all versions but throwing a warining in 2007 excel . please help  i want to expot to excel in all versions.

     

    Response.Clear();

    Response.Buffer = true;

    Response.ContentType = "application/vnd.ms-excel";

    Response.Charset = "";

    this.EnableViewState = false;

    Response.AddHeader("Content-Disposition", "attachment; filename=Goals.xls;");

    System.IO.StringWriter oStringWriter = new System.IO.StringWriter();

    System.Web.UI.HtmlTextWriter oHtmlTextWriter = new System.Web.UI.HtmlTextWriter(oStringWriter);

    ViewAuditHistory();

    this.ClearControls(gvAuditHistory);

    gvAuditHistory.RenderControl(oHtmlTextWriter);

    Response.Write(oStringWriter.ToString());

    Response.End();


    Giri
    • Moved by nobugz Friday, October 3, 2008 1:01 AM Not a 64-bit .NET q (Moved from 64-Bit .NET Framework Development. to Off-Topic Posts (Do Not Post Here))
    Thursday, October 2, 2008 1:29 PM

Answers