asp.net vs2005 操作excel宏进行画图
需求: 从数据库查询处画图数据->利用程序执行一个excel工作簿~-> 在工作簿里面将查询数据列出来并且按照要求画图(饼,曲线,圆柱..)
注:图为excel里面动态的(就是 用户动态改变excel里面的数据时候 图也根据数据改变<次操作为用户客户端操作excel>
不需要插件生成图片的那种! 画图必须和客户端进行数据画图效果一样!!!
详细信息联系QQ:136068548 或者email:vip168861@vip.qq.com
价格联系详谈!
string filename = Server.MapPath("../file1/") + "book2.xls";
ThisApplication = new Microsoft.Office.Interop.Excel.Application();
m_objBooks = (Microsoft.Office.Interop.Excel.Workbooks)ThisApplication.Workbooks;
ThisWorkbook = (Microsoft.Office.Interop.Excel._Workbook)(m_objBooks.Add(Type.Missing));
ThisApplication.DisplayAlerts = false;
this.DeleteSheet();
this.AddDatasheet();
this.LoadData();
Microsoft.Office.Interop.Excel.Chart xlChart = (Microsoft.Office.Interop.Excel.Chart)ThisWorkbook.Charts.Add(Type.Missing, xlSheet, Type.Missing, Type.Missing);
Microsoft.Office.Interop.Excel.Range cellRange = xlSheet.get_Range("A1", "B9");
ThisApplication.Visible = false;
ThisWorkbook.SaveAs(filename, XlFileFormat.xlXMLSpreadsheet, Type.Missing, Type.Missing, false, false, Microsoft.Office.Interop.Excel.XlSaveAsAccessMode.xlNoChange, Type.Missing, Type.Missing, Type.Missing, Type.Missing, Type.Missing);