在asp.net中写入,要求用c#语言,有会的帮帮我好吗

解决方案 »

  1.   

    模板是会做拉,但是要怎么与asp导出到Excel的代码结合起来呢?
    能否给个例子??
      

  2.   

    public static void GenerateByHtmlString(string Typename, string TempHtml)
            {
                HttpContext.Current.Response.Clear();
                HttpContext.Current.Response.Buffer = true;
                HttpContext.Current.Response.Charset = "utf-8";
                string Filename = Typename + ".xls";
                HttpContext.Current.Response.AppendHeader("Content-Disposition", "online;filename=" + Filename);
                HttpContext.Current.Response.ContentEncoding = System.Text.Encoding.GetEncoding("utf-8");
                HttpContext.Current.Response.ContentType = "application/ms-excel";
                //this.EnableViewState = false;
                HttpContext.Current.Response.Write(TempHtml);
                HttpContext.Current.Response.End();
            }Typename为导出的文件名,TempHtml为HTML字符串
      

  3.   

    单独地导出数据到Excel已经会拉,就是想给导出的那个Excel写一个宏,意思就是将数据导出到一个带有宏的Excel中