Send query results to Excel from ASP.NET website

后端 未结 7 1079
失恋的感觉
失恋的感觉 2020-12-17 03:03

We let users create ad-hoc queries in our website. We would like to have the user select their criteria, then click submit and have the results streamed automatically to Ex

7条回答
  •  轻奢々
    轻奢々 (楼主)
    2020-12-17 03:29

    Kindly use this code to resolve your problem.This code will convert excel sheet to text format.Hope this will solve your problem

        grdSrcRequestExport.RenderControl(oHtmlTextWriter);
        string s = "";
        s=oStringWriter.ToString().Replace("", "");
        s="
    "+s.ToString()+"
    "; //Byte[] bContent = System.Text.Encoding.GetEncoding("utf-8").GetBytes(); Response.Write(s);

提交回复
热议问题