日韩久久久精品,亚洲精品久久久久久久久久久,亚洲欧美一区二区三区国产精品 ,一区二区福利

OWC繪圖控件研究(3)

系統 1680 0

1.前臺代碼:

<% ... @PageLanguage = " C# " AutoEventWireup = " true " CodeFile = " testowc.aspx.cs " Inherits = " web_testowc " %>

<! DOCTYPEhtmlPUBLIC"-//W3C//DTDXHTML1.0Transitional//EN""http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd" >
< html xmlns ="http://www.w3.org/1999/xhtml" >
< head runat ="server" >
< title > 無標題頁 </ title >

< script type ="text/javascript" language ="javaScript" src ="/_layouts/images/include/timein.js" ></ script >
< script language ="javascript" > ...
<!--
function Ini()
... {
var chart = document.getElementById( " Chart " ); // newActiveXObject("OWC11.ChartSpace.11");
var c = chart.Constants;
if (chart == null )
... {
alert(
" 您沒有安裝Office! " );
}

chart.Clear();
var m_Chart = chart.Charts.Add( 0 );
// m_Chart.PlotArea.Interior.SetOneColorGradient(c.chGradientVariantStart,c.chGradientVariantStart,0.15,"Silver")

m_Chart.HasLegend
= true

m_Chart.HasTitle
= true
m_Chart.Title.Caption
= " 油耗量統計分析 " ;
m_Chart.Axes(
0 ).HasTitle = true ;
m_Chart.Axes(
0 ).Title.Caption = " 月份 " ;
m_Chart.Axes(
1 ).HasTitle = true ;
m_Chart.Axes(
1 ).Title.Caption = " 油耗量 " ;

m_Chart.type
= 0 ;
<% for ( int i = 0 ;i < arr1.Count;i ++ )
... { %>
var aCats <%= i %> = <% = arr1[i].ToString() %> ;
var aVals <%= i %> = <% = arr2[i].ToString() %> ;
var oSer <%= i %> = m_Chart.SeriesCollection.Add( <% = i %> );
oSer
<%= i %> .SetData(c.chDimSeriesNames, - 1 , <% = i.ToString() %> );
oSer
<%= i %> .SetData(c.chDimCategories, - 1 ,aCats <% = i %> );
oSer
<%= i %> .SetData(c.chDimValues, - 1 ,aVals <% = i %> );
<%
}
%>

chart.AllowPropertyToolbox
= true ;
chart.DisplayToolbar
= true ;

}

-->
</ script >

</ head >
< body onload ="javascript:Ini()" style ="text-align:center" >
< form id ="form1" runat ="server" >
< div style ="text-align:center" >
&nbsp; < table style ="width:874px" >
< tr >
< td colspan ="4" >
</ td >
</ tr >
< tr >
< td style ="text-align:right" >
< input style ="width:125px" id ="txtSTime" readonlytype ="text" runat ="server" />< img
style ="cursor:hand" onclick ="fPopUpCalendarDlg(txtSTime,'/_layouts/images/include/timein.htm','yyyy-mm-dd');returnfalse"
alt
="彈出日歷下拉菜單" src ="/_layouts/images/include/datetime.gif" align ="middle" />
</ td >
< td >
~
</ td >
< td style ="text-align:left" colspan ="2" >
< input style ="width:125px" id ="txtSTime1" readonlytype ="text" runat ="server" />< img
style ="cursor:hand" onclick ="fPopUpCalendarDlg(txtSTime1,'/_layouts/images/include/timein.htm','yyyy-mm-dd');returnfalse"
alt
="彈出日歷下拉菜單" src ="/_layouts/images/include/datetime.gif" align ="middle" />
< asp:DropDownList ID ="DropDownList1" runat ="server" >
</ asp:DropDownList >
< asp:TextBox ID ="TextBox1" runat ="server" Width ="97px" ></ asp:TextBox >
< asp:Button ID ="btnOk" runat ="server" Text ="確定" OnClick ="btnOk_Click" /></ td >
</ tr >
< tr >
< td colspan ="4" style ="height:339px" >
< object id ="Chart" name ="Chart" codebase ="http://www.smnpc.cn/bin/OWC11.DLL#version=11,0,6555,0"
classid
="clsid:0002E55D-0000-0000-C000-000000000046" progid ="OWC11.ChartSpace.11" width ="650px" height ="450px" >
</ object >
</ td >
</ tr >
</ table >
</ div >
</ form >
</ body >
</ html >

2.后臺代碼:

using System;
using System.Data;
using System.Configuration;
using System.Collections;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;
using System.Text;

using System.Data.SqlClient;
using System.Text;
using Yesidea.DAO;

public partial class web_testowc:System.Web.UI.Page
... {
DbHelperSQLdbhelper
= new DbHelperSQL( new BaseDAO());
protected ArrayListarr1 = new ArrayList();
protected ArrayListarr2 = new ArrayList();
protected ArrayListarr3 = new ArrayList();
public string []driver = new string [ 2 ];

protected void Page_Load( object sender,EventArgse)
... {
if ( ! IsPostBack)
... {
Yesidea.BO.CarInfocar
= new Yesidea.BO.CarInfo();
DataSetds
= car.GetList( "" );
this .DropDownList1.DataSource = ds;
this .DropDownList1.DataTextField = " Cnumber " ;
this .DropDownList1.DataValueField = " Cnumber " ;
this .DropDownList1.DataBind();
}

}


protected void btnOk_Click( object sender,EventArgse)
... {
driver
= new string [] ... { " 王云 " , " 測試 " } ;
for ( int j = 0 ;j < driver.Length;j ++ )
... {
GetData(
this .txtSTime.Value, this .txtSTime1.Value, this .DropDownList1.SelectedValue,driver[j].ToString());
}

}


public int MonthStr(DateTimestime,DateTimeetime)
... {
int i = (etime.Year - stime.Year) * 12 + (etime.Month - stime.Month);
return i;
}


protected DataSetCreateDriverOilDataSet( string stime, string etime, string cnumber, string cdriver)
... {
string cmdtxt = String.Empty;
if (stime != "" && etime != "" && cnumber != "" && cdriver != "" )
... {
cmdtxt
= " selectCnumber,Cdriver,sum(cfutel)asFutel,datename(year,Etime)as[Year],datename(month,Etime)as[Month]fromViewDriverUOil " ;
cmdtxt
+= " whereEtime>' " + stime + " 'andEtime<' " + etime + " 'andCdriver=(' " + cdriver + " ')andCnumber=(' " + cnumber + " ') " ;
cmdtxt
+= " groupbyCdriver,Cnumber,datename(month,Etime),datename(year,Etime) " ;
cmdtxt
+= " orderby[Year]asc,[Month]asc " ;
// Response.Write(cmdtxt);
}

else if (stime != "" && etime != "" && cnumber == "" && cdriver != "" )
... {
cmdtxt
= " selectCdriver,sum(cfutel)asFutel,datename(year,Etime)as[Year],datename(month,Etime)as[Month]fromViewDriverUOil " ;
http://im
分享到:
評論

OWC繪圖控件研究(3)


更多文章、技術交流、商務合作、聯系博主

微信掃碼或搜索:z360901061

微信掃一掃加我為好友

QQ號聯系: 360901061

您的支持是博主寫作最大的動力,如果您喜歡我的文章,感覺我的文章對您有幫助,請用微信掃描下面二維碼支持博主2元、5元、10元、20元等您想捐的金額吧,狠狠點擊下面給點支持吧,站長非常感激您!手機微信長按不能支付解決辦法:請將微信支付二維碼保存到相冊,切換到微信,然后點擊微信右上角掃一掃功能,選擇支付二維碼完成支付。

【本文對您有幫助就好】

您的支持是博主寫作最大的動力,如果您喜歡我的文章,感覺我的文章對您有幫助,請用微信掃描上面二維碼支持博主2元、5元、10元、自定義金額等您想捐的金額吧,站長會非常 感謝您的哦!!!

發表我的評論
最新評論 總共0條評論
主站蜘蛛池模板: 卫辉市| 麦盖提县| 北宁市| 溆浦县| 阿尔山市| 田阳县| 科技| 铜山县| 上饶县| 德化县| 和平区| 湄潭县| 社旗县| 枣强县| 仙桃市| 和田市| 通城县| 永昌县| 曲阳县| 河池市| 百色市| 历史| 阿尔山市| 封开县| 龙陵县| 边坝县| 城固县| 东乌| 哈密市| 博野县| 织金县| 柳州市| 宝清县| 罗源县| 寿阳县| 绵阳市| 潜山县| 赞皇县| 巢湖市| 前郭尔| 盐亭县|