如题

解决方案 »

  1.   

    导出datagrid函数如下:
    public void toexecel(DataGrid dg)
    {
    Response.AppendHeader("Content-Disposition","attachment;filename=Excel.xls");
    Response.ContentType = "application/vnd.ms-excel";
    Response.Charset ="";
    Response.ContentEncoding =System.Text.Encoding.Default;
    dg.Page.EnableViewState =false;
    System.IO.StringWriter tw = new System.IO.StringWriter() ;
    System.Web.UI.HtmlTextWriter hw = new System.Web.UI.HtmlTextWriter(tw);
    dg.Visible=true;
    dg.RenderControl(hw);
    Response.Write(tw.ToString());
    Response.End();

    }
      

  2.   

    帮 你 UP大哥,们能不能贴一些office2003 excell服务的资料呀,谢谢!!!!