| 网站首页 | 业界新闻 | 小组 | 威客 | 人才 | 下载频道 | 博客 | 代码贴 | 在线编程 | 编程论坛
欢迎加入我们,一同切磋技术
用户名:   
 
密 码:  
共有 1026 人关注过本帖
标题:ASP高手帮忙
只看楼主 加入收藏
yuanmei1024
Rank: 1
等 级:新手上路
帖 子:7
专家分:0
注 册:2008-3-31
收藏
 问题点数:0 回复次数:1 
ASP高手帮忙
这个是query文件,点了按钮后会转到Dataset页面。

<%
    G_FAC=Request("G_FAC")
    set conn = Server.CreateObject("ADODB.Connection")
    conn.Open Application("LCMDB")
%>
<HTML>
<HEAD>
<link REL="stylesheet" TYPE="text/css" HREF="../../Style/Report.css">
<TITLE></TITLE>
<!-- #include file = "include/show_qryfun.inc" -->
<script language="VBScript">
Window.parent.SetQueryFix()
<!-- #include file = "../../objects/select.vbs" -->
</script>
<script language="VBScript">  
sub ClkQuery()
    tmpDate = frm.Calendar1.value
    frm.vDate_s.value = Year(tmpDate) & "-" & Right("0" & Month(tmpDate),2) &"-" & Right("0" & Day(tmpDate),2)
    tmpDate = frm.Calendar2.value
    frm.vDate_e.value = Year(tmpDate) & "-" & Right("0" & Month(tmpDate),2) &"-" & Right("0" & Day(tmpDate),2)                                

    vSelGroup = "("
    tmpstr = ""
    for i = 1 to frm.in_eqp_grp.children.length
        vSelGroup = vSelGroup & tmpstr & "'" & Trim(frm.in_eqp_grp.children(i-1).value)  & "'"
        tmpstr = ","
    next    
    vSelGroup = vSelGroup & ")"    
    frm.vSelMac.value = vSelGroup  
    
    frm.action = "EventTop10ParetoDataSet.asp"
    frm.target = "DataSetFrame"
    frm.Submit()
end sub
</script>

<body>
<span id="SpanAttention">
<form method="post" action="" name="frm" >      

<%Show_Date(0)%>

<fieldset>
    <%=show_shift(1)%>
</fieldset>
   
<fieldset>
    <%=show_cond1(1)%>
</fieldset>

<fieldset>
    <span style="color:red;font-weight:bold;font-size:10pt">
    <legend>Event Code 顯示選項</legend>
    </span>
    <span  style="color:blue;font-weight:bold;font-size:8pt">
     顯示TOP<input type="text" name="event_cnt"  value="10" size="2">Event Code
    </span>
</fieldset>   

<%Show_Eqp(0)%>

<table width=140px><td align="center">     
    <input type="button" class="mybutton" value="Query" id="QueryBtn"  name="query"  style="HEIGHT: 24px; WIDTH: 68px" onclick="ClkQuery()" ><br>
</td></table>
<input type="hidden" name="G_FAC" value=<%=G_FAC%>>
<input type="hidden" name="vDate_s">
<input type="hidden" name="vDate_e">
<input type="hidden" name="vSelMac">
</form>   
<!-- #include file = "include/show_date.asp" -->
<!-- #include file = "include/select_eqp.asp" -->
</html>

               


这个是Dataset文件,出现的是一个条形图

<head>
    <meta http-equiv="Content-Type" content="text/html; charset=big5">
    <title>CMO FAB4 Report System</title>
    <link REL="stylesheet" TYPE="text/css" HREF="../../Style/Report.css">
    <script language="VBScript" src="../../Objects/print.vbs"></script>
</head>
<body>
<%
'----------------------------------------------------------------------
G_FAC=Request("G_FAC")
set conn = Server.CreateObject("ADODB.Connection")
conn.Open Application("LCMDB")
'----------------------------------------------------------------------
event_cnt=trim(Request("event_cnt"))
if event_cnt="" or IsNumeric(event_cnt)=False then %>
    <script language= "VBScript">
    MSGBOX("No Data For Your Query")
    </script>    
<%    conn.close
    set conn=nothing
    response.end
end if
'----------------------------------------------------------------------
set ReportObj = Server.CreateObject("RTBasicObj.WEBObject")
GridTitle = "LCM"&G_FAC&" Event Code Top "&cint(event_cnt)&" (Pareto)"
Response.Write ReportObj.StartPage("ReportPage2")
Response.Write ReportObj.AddGrid("ReportGrid1", GridTitle, "100%", "100%")
Response.Write ReportObj.EndPage
Response.Write ReportObj.StartPage("ReportPage1")
Response.Write ReportObj.AddChart2D("ReportChart1", GridTitle&"Chart", "100%", "100%")
Response.Write ReportObj.EndPage
Response.Write ReportObj.AddPrint("ReportPrint1")
set ReportObj = nothing
'----------------------------------------------------------------------

vSelR1 = Request.Form("vSelShow")
vDate_s = Request.Form("vDate_s")
vDate_e = Request.Form("vDate_e")
vSelMac = Request.Form("vSelMac")
sqlshift = Request.Form("shift")
building = Request("building")
floor = Request("floor")

if InStr( 1, vSelMac, "ALL" )=0 and vSelMac <> "()" then
    vMacStr=" and equip_nbr in " & vSelMac
end if

table_name1= "HM"&G_FAC&"SEQP_EQSUM"
table_name2= "HM"&G_FAC&"SHIS_EDCS"

if G_fac="D" or G_FAC="A" then
    sqlstr_bf=floor
elseif G_fac="B" or G_FAC="C" then
    sqlstr_bf=building
end if
vMacStr =  vMacStr  & sqlstr_bf
sqlstr ="select sum(s.freg) count1 ,s.code as dfct_code  ,e.c_desc as errc_descr from (select distinct code,c_desc,entity_status,eq_status from "&table_name2&" order by code) e right join "&table_name1&" s " &_
    " on e.code=s.code where s.fac_id='"&G_FAC&"' and acct_date >= '"& vDate_s &"' and acct_date <= '" & vDate_e & "' " & _
    vMacStr & " and (s.code like '5%' and s.code not in('5000','5002')) group by s.code,e.c_desc order by count1 desc "    

 response.write sqlstr
 'response.end                        
Set Rs = Server.CreateObject("ADODB.Recordset")
Rs.Open sqlstr,Conn,3,3    
response.write sqlstr


if  Rs.EOF then%>
    <script language= "VBScript">
    MSGBOX("No Data For Your Query")
    </script>    
    <%
    rs.close
    set rs=nothing
    conn.close
    set conn=nothing
    response.end   
end if   

sqlstr ="select nvl(sum(s.freg),0) count1 from (select distinct code,c_desc,entity_status,eq_status from "&table_name2&" order by code) e right join "&table_name1&" s " &_
    " on e.code=s.code where s.fac_id='"&G_FAC&"' and acct_date >= '"& vDate_s &"' and acct_date <= '" & vDate_e & "' " & _
    vMacStr & " and (s.code like '5%' and s.code not in('5000','5002')) "    

response.write sqlstr                        
Set Rs1 = Server.CreateObject("ADODB.Recordset")
Rs1.Open sqlstr,Conn,3,3    
%>
         
<script language= "VBScript">
'Initial the page format
window.parent.ShowMainPage
set tmpSpan = document.all.tags("span")

ReportChart1.Header.Text.Clear
ReportChart1.Header.Text.Add " "
ReportChart1.Axis.Left.Title.Caption = "次數"
ReportChart1.Axis.right.Title.Caption = "累計次數"
ReportChart1.Axis.Bottom.Labels.Angle=90
ReportChart1.Legend.Visible = false                     
ReportChart1.Axis.Left.Automatic=False
ReportChart1.Axis.Left.Maximum =<%=rs1("count1")%>
ReportChart1.Axis.Left.Minimum = 0
ReportChart1.Axis.Left.Increment=1
ReportChart1.Axis.Right.Automatic=False
ReportChart1.Axis.Right.Maximum =<%=rs1("count1")%>
ReportChart1.Axis.Right.Minimum = 0
ReportChart1.Axis.Right.Increment=1

ReportChart1.AddSeries(1)
ReportChart1.AddSeries(0)
ReportChart1.Series(1).asLine.Pointer.Style = 1 'circle
ReportChart1.Series(1).asLine.Pointer.Visible = True 'circle
ReportChart1.Series(1).VerticalAxis = 1
ReportChart1.Page.MaxPointsPerPage = 11
ReportChart1.Series(0).asBar.BarWidth= 25
ReportChart1.Series(0).asBar.BarWidthPercent=100
'ReportChart1.Series(0).Marks.Visible = Ture
'ReportChart1.Series(1).Marks.Visible = Ture
ReportChart1.Series(0).Marks.style=0
ReportChart1.Series(0).Marks.Frame.Width=1


ReportGrid1.rows =11
ReportGrid1.cols =6
ReportGrid1.fixedrows =1
ReportGrid1.fixedcols =1
ReportGrid1.FontSize=9
'ReportGrid1.FontName="Comic Sans MS"
ReportGrid1.TextMatrix(0,0) = "NO"
ReportGrid1.TextMatrix(0,1) = "Event"
ReportGrid1.TextMatrix(0,2) = "現況"
ReportGrid1.TextMatrix(0,3) = "原因"
ReportGrid1.TextMatrix(0,4) = "對策"
ReportGrid1.TextMatrix(0,5) = "Notes"
ReportGrid1.MergeCells = 3
ReportGrid1.Mergecol(0)= True
ReportGrid1.Colwidth(0)= 600
ReportGrid1.Colwidth(1)= 2600
</script>
<%
On Error Resume Next         


i=0
j=0
total=0                  
Do While Not rs.EOF and Err = 0
    if i< cint(event_cnt) then
        total=total+cdbl(rs("count1")) %>
        <script language= "VBScript">
        ReportGrid1.TextMatrix(<%=i+1%>,0) = "<%=i+1%>"
        ReportGrid1.TextMatrix(<%=i+1%>,1) = "<%=trim(rs("errc_descr"))%>"
        ReportChart1.Series(0).AddXY <%=J%>,Cdbl(<%=cdbl(rs("count1"))%>),"<%=trim(rs("errc_descr"))%>",RGB(255,0,0)
        ReportChart1.Series(1).AddXY <%=J%>,Cdbl(<%=cdbl(total)%>),<%=I%>,RGB(0,0,0)
        </script>
<%        
        J = J+1  
        i = i+1
    end if   
    rs.MoveNext   
loop
rs1.close
set rs1=nothing
rs.close
set rs=nothing
conn.close
set conn=nothing
%>
<SCRIPT LANGUAGE=vbscript>
Sub ReportReportGrid1_Print()
    MyTitle = "<%=GridTitle%>"
    orientation = 1
    print_grid_2 ReportPrint1, ReportReportGrid1, MyTitle,now
End Sub
</SCRIPT>   
</body>
</html>


问题是想在条形图上面一点击就会出现条形图上的详细信息,要怎么办呢,非常感谢啊

桌面.rar (3.43 KB)
搜索更多相关主题的帖子: FAC ASP script 
2008-04-30 15:00
hxfly
Rank: 5Rank: 5
等 级:贵宾
威 望:17
帖 子:5810
专家分:118
注 册:2005-4-7
收藏
得分:0 
数据库中有改图片的详细信息吗?有的话就能做,没有就不好说了
有的话在<img src= alt=<%rs("图片信息")%>>,这种方法是最简单的,鼠标划过的时候会显示

2008-05-01 00:23
快速回复:ASP高手帮忙
数据加载中...
 
   



关于我们 | 广告合作 | 编程中国 | 清除Cookies | TOP | 手机版

编程中国 版权所有,并保留所有权利。
Powered by Discuz, Processed in 0.025109 second(s), 8 queries.
Copyright©2004-2024, BCCN.NET, All Rights Reserved