学习ING,,,,,,,,,,,顶................

解决方案 »

  1.   

    看看这些链接,希望能对你有帮助:
    http://www.codeproject.com/dotnet/ExportExcelData.asp
    http://www.codeproject.com/csharp/csharp_excel.asp
      

  2.   

    [email protected]
    Any help will be appreciated and paid back with point;-)
      

  3.   

    已经发了,是163.com的邮箱,请查收,另外两位也发了,请收
      

  4.   

    to zhangzgl(老张) 
    可否给我一份,拜托了
    [email protected]
      

  5.   

    to zhangzgl:
    thanks!the program haven't Excel powerful functions, such as visualization.
      

  6.   

    how to integrate the program and Excel?
    when the excel change something,the program also change automatically.
      

  7.   

    我的这个小工具是按照要求做的,所以并未实现强大的功能,Excel Com 还有很多功能,请看这两个帖子,看看对你的问题是否有帮助
    http://dev.csdn.net/develop/article/9/9531.shtm
    http://dev.csdn.net/develop/article/9/9530.shtm
      

  8.   

    Excel怎么作为插件,在.net环境中?
      

  9.   

    no man has this experience? So should i can my method?
    i will go out for two days. I hope someone will give me a help during this time.
    thanks a lot!
      

  10.   

    这个文件夹下面有所有的VBA的帮助,如果没有你在宏编辑状态下安装一下
    C:\Program Files\Microsoft Office\Office10\1033
      

  11.   

    http://msdn.microsoft.com/office/understanding/excel/gettingstarted/default.aspx?pull=/library/en-us/odc_vsto2003_ta/html/excelobj.asp
      

  12.   

    try
    {
    Excel.Application excel = new Excel.Application() ;
    excel.Application.Workbooks.Add(true);
    //excel.Visible = true;
    try
    {
    excel.Caption = "内部对帐单";
    for (i=0;i<myds.Tables["mytable"].Rows.Count;i++)
    {
    this.progressBar1.Value = this.progressBar1.Value +1;
    excel.Cells[j,2] = myds.Tables["mytable"].Rows[i]["kjqj"].ToString().Substring(0,4)+"年"+
    myds.Tables["mytable"].Rows[i]["kjqj"].ToString().Substring(4,2)+"月营销员内部对帐单";
    j++;
    excel.Cells[j,1] = myds.Tables["mytable"].Rows[i]["dqmc"].ToString()+
    myds.Tables["mytable"].Rows[i]["bmmc"].ToString()+
    myds.Tables["mytable"].Rows[i]["ryxm"].ToString()+"业务员";
    j++;
    excel.Cells[j,1] = "现将你"+myds.Tables["mytable"].Rows[i]["kjqj"].ToString()+"月份帐目情况给你,请你核对无误后签字。";
    j++;
    excel.Cells[j,1] = "一、货款情况";
    j++;
    excel.Cells[j,1] = "本月发货";
    excel.get_Range(excel.Cells[j,1],excel.Cells[j,1]).Borders.LineStyle = 1;
    excel.Cells[j,2] = "本年发货";
    excel.get_Range(excel.Cells[j,2],excel.Cells[j,2]).Borders.LineStyle = 1;
    excel.Cells[j,3] = "本月回款";
    excel.get_Range(excel.Cells[j,3],excel.Cells[j,3]).Borders.LineStyle = 1;
    excel.Cells[j,4] = "本年回款";
    excel.get_Range(excel.Cells[j,4],excel.Cells[j,4]).Borders.LineStyle = 1;
                            excel.Cells[j,5] = "上年末欠款";
    excel.get_Range(excel.Cells[j,5],excel.Cells[j,5]).Borders.LineStyle = 1;
    excel.Cells[j,6] = "本年欠款";
    excel.get_Range(excel.Cells[j,6],excel.Cells[j,6]).Borders.LineStyle = 1;
    excel.Cells[j,7] = "累计欠款";
    excel.get_Range(excel.Cells[j,7],excel.Cells[j,7]).Borders.LineStyle = 1;
    excel.Cells[j,8] = "本年回款率";
    excel.get_Range(excel.Cells[j,8],excel.Cells[j,8]).Borders.LineStyle = 1;
    excel.Cells[j,9] = "累计回款率";
    excel.get_Range(excel.Cells[j,9],excel.Cells[j,9]).Borders.LineStyle = 1;
    j++;
    excel.Cells[j,1] = myds.Tables["mytable"].Rows[i]["byfh"].ToString();
    excel.get_Range(excel.Cells[j,1],excel.Cells[j,1]).Borders.LineStyle = 1;
    excel.Cells[j,2] = myds.Tables["mytable"].Rows[i]["bnfh"].ToString();
    excel.get_Range(excel.Cells[j,2],excel.Cells[j,2]).Borders.LineStyle = 1;
    excel.Cells[j,3] = myds.Tables["mytable"].Rows[i]["byhk"].ToString();
    excel.get_Range(excel.Cells[j,3],excel.Cells[j,3]).Borders.LineStyle = 1;
    excel.Cells[j,4] = myds.Tables["mytable"].Rows[i]["bnhk"].ToString();
    excel.get_Range(excel.Cells[j,4],excel.Cells[j,4]).Borders.LineStyle = 1;
    excel.Cells[j,5] = myds.Tables["mytable"].Rows[i]["snqk"].ToString();
    excel.get_Range(excel.Cells[j,5],excel.Cells[j,5]).Borders.LineStyle = 1;
    excel.Cells[j,6] = myds.Tables["mytable"].Rows[i]["bnqk"].ToString();
    excel.get_Range(excel.Cells[j,6],excel.Cells[j,6]).Borders.LineStyle = 1;
    excel.Cells[j,7] = myds.Tables["mytable"].Rows[i]["ljqk"].ToString();
    excel.get_Range(excel.Cells[j,7],excel.Cells[j,7]).Borders.LineStyle = 1;
    excel.Cells[j,8] = myds.Tables["mytable"].Rows[i]["bnhkl"].ToString();
    excel.get_Range(excel.Cells[j,8],excel.Cells[j,8]).Borders.LineStyle = 1;
    excel.Cells[j,9] = myds.Tables["mytable"].Rows[i]["ljhkl"].ToString();
    excel.get_Range(excel.Cells[j,9],excel.Cells[j,9]).Borders.LineStyle = 1;
    j++;
    excel.Cells[j,1] = "二、借款情况";
    j++;
    excel.Cells[j,1] = "累计借款";
    excel.get_Range(excel.Cells[j,1],excel.Cells[j,1]).Borders.LineStyle = 1;
    excel.Cells[j,2] = "本月借款";
    excel.get_Range(excel.Cells[j,2],excel.Cells[j,2]).Borders.LineStyle = 1;
    excel.Cells[j,3] = "本月回款";
    excel.get_Range(excel.Cells[j,3],excel.Cells[j,3]).Borders.LineStyle = 1;
    excel.Cells[j,4] = "本月提成合计";
    excel.get_Range(excel.Cells[j,4],excel.Cells[j,4]).Borders.LineStyle = 1;
    excel.Cells[j,5] = "结转上月扣除后剩余提成为负";
    excel.get_Range(excel.Cells[j,5],excel.Cells[j,5]).Borders.LineStyle = 1;
    excel.Cells[j,6] = "本月扣罚合计";
    excel.get_Range(excel.Cells[j,6],excel.Cells[j,6]).Borders.LineStyle = 1;
    excel.Cells[j,7] = "本月扣除后剩余提成";
    excel.get_Range(excel.Cells[j,7],excel.Cells[j,7]).Borders.LineStyle = 1;
    excel.Cells[j,8] = "应贴票金额";
    excel.get_Range(excel.Cells[j,8],excel.Cells[j,8]).Borders.LineStyle = 1;
    excel.Cells[j,9] = "累计投入中途差旅费";
    excel.get_Range(excel.Cells[j,9],excel.Cells[j,9]).Borders.LineStyle = 1;
                            excel.Cells[j,10] ="短途差旅费";
    excel.get_Range(excel.Cells[j,10],excel.Cells[j,10]).Borders.LineStyle = 1;
    excel.Cells[j,11] ="累计欠款";
    excel.get_Range(excel.Cells[j,11],excel.Cells[j,11]).Borders.LineStyle = 1;
    excel.Cells[j,12] ="个人所得税";
    excel.get_Range(excel.Cells[j,12],excel.Cells[j,12]).Borders.LineStyle = 1;
                            j++;
    excel.Cells[j,1] = myds.Tables["mytable"].Rows[i]["ljjkye"].ToString();
    excel.get_Range(excel.Cells[j,1],excel.Cells[j,1]).Borders.LineStyle = 1;
    excel.Cells[j,2] = myds.Tables["mytable"].Rows[i]["byjk"].ToString();
    excel.get_Range(excel.Cells[j,2],excel.Cells[j,2]).Borders.LineStyle = 1;
    excel.Cells[j,3] = myds.Tables["mytable"].Rows[i]["byhk"].ToString();
    excel.get_Range(excel.Cells[j,3],excel.Cells[j,3]).Borders.LineStyle = 1;
    excel.Cells[j,4] = myds.Tables["mytable"].Rows[i]["bytchj"].ToString();
    excel.get_Range(excel.Cells[j,4],excel.Cells[j,4]).Borders.LineStyle = 1;
    excel.Cells[j,5] = myds.Tables["mytable"].Rows[i]["jzsytc"].ToString();
    excel.get_Range(excel.Cells[j,5],excel.Cells[j,5]).Borders.LineStyle = 1;
    excel.Cells[j,6] = myds.Tables["mytable"].Rows[i]["bykfhj"].ToString();
    excel.get_Range(excel.Cells[j,6],excel.Cells[j,6]).Borders.LineStyle = 1;
    excel.Cells[j,7] = myds.Tables["mytable"].Rows[i]["bytcsy"].ToString();
    excel.get_Range(excel.Cells[j,7],excel.Cells[j,7]).Borders.LineStyle = 1;
    excel.Cells[j,8] = myds.Tables["mytable"].Rows[i]["ytpje"].ToString();
    excel.get_Range(excel.Cells[j,8],excel.Cells[j,8]).Borders.LineStyle = 1;
    excel.Cells[j,9] = myds.Tables["mytable"].Rows[i]["ljtyclf"].ToString();
    excel.get_Range(excel.Cells[j,9],excel.Cells[j,9]).Borders.LineStyle = 1;
    excel.Cells[j,10] =myds.Tables["mytable"].Rows[i]["dtclf"].ToString();
    excel.get_Range(excel.Cells[j,10],excel.Cells[j,10]).Borders.LineStyle = 1;
    excel.Cells[j,11] =myds.Tables["mytable"].Rows[i]["ljqk"].ToString();
    excel.get_Range(excel.Cells[j,11],excel.Cells[j,11]).Borders.LineStyle = 1;
    excel.Cells[j,12] =myds.Tables["mytable"].Rows[i]["grsds"].ToString();
    excel.get_Range(excel.Cells[j,12],excel.Cells[j,12]).Borders.LineStyle = 1;
    j++;
    excel.Cells[j,1] = "要求:请在20日之前将内部对帐签字后返回公司,如有疑问,请填写查帐申请。";
    j++;
    excel.Cells[j,1] = "若不按时返回或不合格,将停止借款或发货。";
    j++;
    j++;
    }
    MessageBox.Show("数据导出完毕。");
    this.Close();
    excel.Visible = true;
    }
    catch (Exception ex)
    {
    MessageBox.Show(ex.Message);
    excel.Quit();
    }
    }
    catch (Exception ex)
    {
    MessageBox.Show("没有安装EXCEL。"+"\n"+ex.Message);
    }
      

  13.   

    看看这个是否对你有用,可以吧office当做插件
      

  14.   

    http://tech.ccidnet.com/pub/article/c1135_a47285_p1.html
      

  15.   

    关注office 2003!.net开发支持加强了,但不知用office2003实现的应用程序能否用于低版本的office?
      

  16.   

    我根据例子写了一个程序,但是有错
    http://community.csdn.net/Expert/TopicView.asp?id=3233333/////////////////////////////////////////////////////////
    我用下列方法打开Excel(来自网上例子)
    string strFileName = "a.xls";
    Object refmissing = System.Reflection.Missing.Value;
    axWebBrowser1.Navigate(strFileName, ref refmissing , ref refmissing , ref refmissing , ref refmissing);axWebBrowser1.ExecWB(SHDocVw.OLECMDID.OLECMDID_HIDETOOLBARS, SHDocVw.OLECMDEXECOPT.OLECMDEXECOPT_DONTPROMPTUSER,ref refmissing , ref refmissing);
    出错在最后一句,ExceWB的作用是显示操作excel的图标按钮,如果没有这句,可以正常打开Excel,但对Excel的可操作性有限!出错信息是:
    未处理异常System.Runtime.InteropServices.COMException出现在axinterop.shdocvw.dll中
    其他信息:试图吊销一个未注册的拖放目标
    ////////////////////////////////////////////////////////////////////////////
      

  17.   

    msdn 中有EricC#开发组的经理的一个这样的文章。
    自己看。
      

  18.   

    为什么一定要实现父子窗口呢?其实使用Excel为单独的窗口(另一个进程)也可以实现你要的这种功能。
    具体实现方法:你可以用Excel建一个模板出来保存在系统目录或你自己的系统的目录下面,然后,使用你自己开发的界面来完成你要实现的功能。不是一样吗?
    比如:可以把Excel里面的所有界面改为自己的。只是风格与传统Excel一致。这不是什么难点。
    难点主要是在你要实现的功能如何在Excel里面表现出来而已。
      

  19.   

    to cocosoft:
    我主要是想利用Excel强大的数据可视化功能,需保存回程序
      

  20.   

    to cocosoft:
    就以Excel文件保存就可以了
      

  21.   

    如果你要保存成Excel文件的话。你可以直接使用Excel自带的保存功能。如果用C#代码编写Excel的保存方法的话。那么,你看一下下面的代码:
    xBk.SaveAs(fileName,Missing.Value,
    Missing.Value,Missing.Value,
    Missing.Value,Missing.Value,Excel.XlSaveAsAccessMode.xlExclusive,Missing.Value,
    Missing.Value,Missing.Value,
    Missing.Value,Missing.Value);
    这一句就是保存Excel的语句。
    其中,你要添加引用:using System.Reflection;与:using Excel;
    xBk是Excel._Workbook xBk;
    可以完成你想要的功能。而fileName就是你要保存的文件名。
      

  22.   

    wkbook.SaveAs(fileName,Excel.XlFileFormat.xlWorkbookNormal,Type.Missing,
    Type.Missing,Type.Missing,Type.Missing,
    Excel.XlSaveAsAccessMode.xlNoChange,
    Type.Missing,Type.Missing,Type.Missing,Type.Missing,Type.Missing);

    excel.Quit();
      

  23.   

    其实和以前vb下是一样的,先要添加引用microsoft excel9.0
    然后操作Application对象里的东西。别的没什么,但要记得先引用一下
      

  24.   

    我已经采用webbrowser控件来显示了,不知大家有什么想法,可以探讨一下