http://expert.csdn.net/Expert/topic/2501/2501697.xml?temp=.5529444

解决方案 »

  1.   

    孟子的网站上有的,aspcn也有去看看吧。
      

  2.   

    http://xml.sz.luohuedu.net/xml/ShowList.asp?id=1
      

  3.   

    to: killerwc(Elove^_^CS~B43) 
    请问有没有使用owc的例子,谢谢!
    使用excel application 进程老存在
      

  4.   

    to: killerwc(Elove^_^CS~B43) 
    请问有没有使用owc的例子,谢谢!
    使用excel application 进程老存在
    我用过owc,不过老有问题,觉得还是用excel组件。
    你可以上csdn 文档中心 搜索 excel ,里面有两篇文章不错。我就是看后做的。
    祝你成功/
      

  5.   

    使用GC.Collect之后,进程应该没有了
      

  6.   

    public static void ToExcelByOWC11(DataRow[] foundRows,DataColumnCollection Columns)
    {
    if(foundRows.Length <0 || Columns.Count<0)
    return ;
    else
    {
    //using owc11 ActiveX controls
    try
    {
    Owc11.SpreadsheetClass xlsheet=new Microsoft.Office.Interop.Owc11.SpreadsheetClass();

    for (int n=1;n<=Columns.Count ;n++)
    {
    //为EXCEL表得到列名
    xlsheet.ActiveSheet.Cells[1,n]=Columns[n-1].ColumnName ;
    }
    //填充数据
    for (int k=1;k<=foundRows.Length ;k++)
    {
    for (int t=1;t<=Columns.Count  ;t++)
    {
    xlsheet.ActiveSheet.Cells[k+1,t]=foundRows[k-1][t-1].ToString();
    }
    }
    xlsheet.AutoFit=true;
    xlsheet.Columns .AutoFit();
    xlsheet.Rows.AutoFit();
    xlsheet.Export(System.Web.HttpContext .Current .Server.MapPath(".")+"\\"+"temp.xls",Owc11.SheetExportActionEnum.ssExportActionNone ,Owc11.SheetExportFormat .ssExportAsAppropriate  );
    DownloadFile("temp.xls");
    }
    catch
    {}
    }
    }