把画面中的数据导入现有的excel模板中,具体的实现步骤是什么?? 该如何下手,我是一个新手,望各位大虾多多帮忙!!
再有:向excel写入数据的时候,有如下代码:
object m_objOpt = System.Reflection.Missing.Value;
m_objBook.Close(false,m_objOpt,m_objOpt);系统报System.NullReferenceException异常,什么原因??

解决方案 »

  1.   

    m_objBook.Close(m_objOpt ,m_m_objOpt ,m_m_objOpt );
      

  2.   

    看了几篇文章,说通过Excel对象来操作,但以前没做过,不知道如何下手,由那位做过这方面的大哥大姐,帮忙出以下注意呀!!在线等.
      

  3.   

    http://dotnet.aspx.cc/ShowDetail.aspx?id=EC5E84EC-68F9-4CD7-9E11-6F5C92027F0B
      

  4.   

    http://dotnet.aspx.cc/ShowDetail.aspx?id=6AFBF00B-459D-4642-AD14-8A4765FFAFCC
    http://dotnet.aspx.cc/ShowDetail.aspx?id=BF0A54F9-C7C7-4200-BD9A-802AC1F5DE50
      

  5.   

    我现在有一个excel的模板,需要把画面中dataGrid中的内容读去到excel中,具体的步骤能不能写一下.该如何的保存这个excel文件
      

  6.   

    void ToExcel(System.Web.UI.Control ctl)  
    {
    // HttpContext.Current.Response.Charset ="GB2312";
    HttpContext.Current.Response.Charset ="GB2312";
    HttpContext.Current.Response.AppendHeader("Content-Disposition","attachment;filename=memory.xls");

    HttpContext.Current.Response.ContentEncoding =System.Text.Encoding.GetEncoding("GB2312"); 
    HttpContext.Current.Response.ContentType ="application/ms-excel";//image/JPEG;text/HTML;image/GIF;vnd.ms-excel/msword
    ctl.Page.EnableViewState =false;
    System.IO.StringWriter  tw = new System.IO.StringWriter() ;
    System.Web.UI.HtmlTextWriter hw = new System.Web.UI.HtmlTextWriter (tw);
    ctl.RenderControl(hw);
    HttpContext.Current.Response.Write(tw.ToString());
    HttpContext.Current.Response.End();
    }