所有运行成功的前提是: 必须安装了 office
default.aspx 页面
<body>
<form id="form1" runat="server">
<div>
<asp:Image ID="Image1" runat="server" /></div>
</form>
</body>
在aspx.cs 文件里面写上
引入空间的同时,还要在bin 文件里添加引用。
using Microsoft.Office.Interop.Owc11; (引入空间)
Microsoft Office XP Web Components(添加引用)
private void MakeLineChart()
{
//Y坐标轴
string[] DataName = { "星期一", "星期二", "星期三", "星期四", "星期五", "星期六", "星期日" };
//第一条曲线的数据
int[] Data = { 0, 10, 20, 100, 40, 50, 60 };
//第二条曲线的数据
int[] Data1 = { 100, 50, 41, 86 };
//第三条曲线的数据
int[] Data2 = { 10, 50, 100, 30, 50, 60 };
string strValue1 = "";
string strValue = "";
string strValue2 = "";
string strCateory = "";
//循环取得数据并格式化为OWC10需要的格式,(加'/t')
for (int i = 0; i < DataName.L