| 网站首页 | 业界新闻 | 小组 | 威客 | 人才 | 下载频道 | 博客 | 代码贴 | 在线编程 | 编程论坛
欢迎加入我们,一同切磋技术
用户名:   
 
密 码:  
共有 559 人关注过本帖
标题:ASP高手啊~~help~~
只看楼主 加入收藏
yuanmei1024
Rank: 1
等 级:新手上路
帖 子:7
专家分:0
注 册:2008-3-31
收藏
 问题点数:0 回复次数:0 
ASP高手啊~~help~~
<%
    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)                                

    vSelGRP = ""
    vSelMac = ""        
    tmpstr = ""    
    
    vSelGRP = frm.select1.value
    for i = 1 to frm.in_prod_grp.children.length
        vSelGRP = vSelGroup & tmpstr & "'" & Trim(frm.in_prod_grp.children(i-1).value) & "'"
        tmpstr = ","
    next    
    vSelGroup = vSelGroup & ")"            

    frm.vSelGroup.value = vSelGroup

    vSelGroup = "("
    tmpstr = ""
    for i = 1 to frm.in_owner.children.length
        vSelGroup = vSelGroup & tmpstr & "'" & Trim(frm.in_owner.children(i-1).value) & "'"
        tmpstr = ","
    next    
    vSelGroup = vSelGroup & ")"            
    frm.lcm_owner.value = vSelGroup    

    vSelGroup = "("
    tmpstr=""
    for i = 1 to frm.select2.children.length
        vSelMac = vSelMac & tmpstr & Trim(frm.select2.children(i-1).value)
        tmpstr = ","
    
    next                
    frm.vSelMac.value = vSelMac               
    frm.vSelGroup.value = vSelGroup        
    
    
    frm.action = "DailyReortDataSet.asp"
    frm.target = "DataSetFrame"
    frm.Submit()
end sub

</script>
<body>

<span id="SpanAttention">
    <fieldset>
    <td width="100%"></td><td style="vertical-align:top"></td></tr><tr><td colspan=5>
        <table border=0>
            <tr><td><font color=Indigo><b>Update:</b></font></td></tr>
            <td>
            <span style="font-size:10pt;font-weight:bold;color:Indigo">
            <%
            set rs = conn.Execute("Select CUTTIME from A4RLOG_EXECSTAT@PHAMR Where APPNAME = 'SP_HMASPAS_SOUTPUT'")
            if not rs.eof then Response.Write Replace(Left(rs(0), 19), ".", ":")
            rs.Close
            set rs = nothing
            %>
            </span>
        </td></tr></table>
        </fieldset>
<form method="post" action="" name="frm">
<%Show_Date(0)%>
<fieldset>
    <%=show_shift(1)%>
</fieldset>
<fieldset>
    <%=show_cond1(2)%>
</fieldset>
<%show_lcm_prodtype()%>
<%show_prod()%>
<%show_lcm_owner()%>
<%Show_Eqp(0)%>
<input type="hidden" name="G_FAC" value=<%=G_FAC%>>
<input type="hidden" name="lcm_owner">
<input type="hidden" name="calendar_1">
<input type="hidden" name="calendar_2">
<input type="hidden" name="vSelGroup">

<table width=140px><td align="center">
    <input type="button" class="mybutton"  value="Query" id="QueryBtn"  name="query"  style="HEIGHT: 30px; WIDTH: 80px" onclick="ClkQuery()" ><br>
</td></table>
</P>
<!-- #include file = "include/show_date.asp" -->
<!-- #include file = "include/select_prod.asp" -->
<!-- #include file = "include/select_lcm_owner.asp" -->
<!-- #include file = "include/select_lcm_prod_type.asp" -->
<!-- #include file = "include/select_eqp.asp" -->
</form>
<%
conn.Close  
Set conn = Nothing
%>
</span>
</BODY>
</HTML>








<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")
'----------------------------------------------------------------------
set ReportObj = Server.CreateObject("RTBasicObj.WEBObject")
GridTitle1 = "LCM"&G_FAC&" Operation Performance "
GridTitle2 = "LCM"&G_FAC&" Operation Performance Rework "
Response.Write ReportObj.StartPage("ReportPage1")
Response.Write ReportObj.AddGrid("ReportGrid1", GridTitle1, "100%", "50%")
Response.Write ReportObj.AddGrid("ReportGrid2", GridTitle2, "100%", "50%")
Response.Write ReportObj.EndPage
Response.Write ReportObj.AddPrint("ReportPrint1")
set ReportObj = nothing
'----------------------------------------------------------------------

'----------------------------------------------------------------------
table_name1= "HM"&G_FAC&"SPAS_SOUTPUT"
table_name2= "HM"&G_FAC&"SWIP_STAY"
table_name3= "HM"&G_FAC&"PHIS_EQPS"
table_name4 = "HM"&G_FAC&"SHIS_IPMS"
'----------------------------------------------------------------------
'if G_FAC=4 or G_FAC=1 then
    SQLbu1=floor
    SQLbu2=floor
'elseif G_FAC=2 or G_FAC=3 then
'    if building="A" then
'        SQLbu1=" and last_eqp_nbr in (select equip_nbr from "&table_name3&" where building='A')"
'        SQLbu2=" and equip_nbr in (select equip_nbr from "&table_name3&" where building='A')"
'    elseif building="B" then
'        SQLbu1=" and last_eqp_nbr in (select equip_nbr from "&table_name3&" where building='B')"
'        SQLbu2=" and equip_nbr in (select equip_nbr from "&table_name3&" where building='B')"
'    end if
'end if

SQLbu2=SQLbu2&shift

nDate_e1=split(DateAdd("d",1,vDate_e1),"/")
if len(nDate_e1(1))=1 then
    mm="0"&nDate_e1(1)
else
    mm=nDate_e1(1)
end if
if len(nDate_e1(2))=1 then
    dd="0"&nDate_e1(2)
else
    dd=nDate_e1(2)
end if
rDate_e1=nDate_e1(0)&"-"&mm&"-"&dd


sql_m=  " and acct_date >= '" & vDate_s  & "' and acct_date <= '"& vDate_e1 &"'"
sql_m1=  " and trans_date >= '" & vDate_s  & " 07:30:00.000000' and trans_date <= '"& rDate_e1&" 07:30:00.000000'"

if Instr(1,prod_nbr1, "ALL" )=0 and prod_nbr1 <> "()"  and prod_nbr1<>"" then
    StrSql_w = " And Prod_Nbr in "&prod_nbr1
else
    If Product <> "ALL" Then
        StrSql_w = " And Substr(Prod_Nbr,1,5)='" & Product & "' "
    End If
end if

if Prod_type<> "ALL" then
    if Prod_type="Normal" then
        StrSql_w = StrSql_w & " and prod_nbr in (select part_nbr from "&table_name4&" where fac_id='"&G_FAC&"' and (prod_type is  null or prod_type=' ')) "
    else
        StrSql_w = StrSql_w & " and prod_nbr in (select part_nbr from "&table_name4&" where fac_id='"&G_FAC&"' and prod_type='"&prod_type& "') "
    end if
end if

if Instr(1,owner_code, "ALL" )=0 and owner_code <> "()"  then
    StrSql_w = StrSql_w & " and lcm_owner in " & owner_code  
end if

If  Instr(1,grade_code, "ALL" )=0 and grade_code <> "()"  Then
        StrSql_w = StrSql_w & " And lcd_Grade in " & grade_code
End If

StrSql_w1 = StrSql_w & " and  to_wc > 1000  "
StrSql_w2 = StrSql_w & " and  work_ctr > 1000  "
StrSql_w3 = StrSql_w & " and  work_ctr > 1000 "

StrSql_w4 = StrSql_w                             'for OperPerfDetail8.asp
StrSql_w = StrSql_w &  " and  main_wc > 1000 "


StrSql_w = StrSql_w  & shift
StrSql_w1 = StrSql_w1 & shift


'response.write "sql_p:"& sql_p &"<br>"

'--WWOH資料--
Set rs = Server.CreateObject("ADODB.Recordset")

'SQL01 = " with a1 as  (Select Fac_ID,Work_Ctr,0 as PASS_qty,0 totalrwk_qty,0 firstrwk_qty,0 tobescrap_qty,0 pass1_qty,0 pass2_qty,0 IN_QTY,Sum(qty) as Wip_qty   "
'SQL01 = SQL01 & "  From "&table_name2
'SQL01 = SQL01 & " Where Fac_ID='" & G_Fac &"'" &sqlbu1& sql_p & StrSql_w2 & " and Acct_Date ='" & vDate_e1 & "' and work_ctr>1000  Group By Fac_ID,Work_Ctr) "
'SQL01 = SQL01 & " , a2 as (Select fac_id, main_wc as WORK_CTR,sum(  case when main_wc<2000 or main_wc>3000 then pass_Qty "
'SQL01 = SQL01 & " when main_wc between 2000 and 3000 "
'SQL01 = SQL01 & "  and  ((trans_type='MVIN' and output_fg='-') or trans_type<>'MVIN') then Qty else 0 end ) PASS_qty, "
'SQL01 = SQL01 & "  sum( rwk_qty) totalrwk_qty, sum( case when stimes_ttl<=1 then rwk_qty else 0 end ) firstrwk_qty,"
'SQL01 = SQL01 & "  0 as tobescrap_qty , sum( case when stimes_ttl=0  then pass_qty   else 0 end )  pass1_qty ,"
'SQL01 = SQL01 & "  sum(case when stimes_ttl>1 and (main_wc<2000 or main_wc>3000)then pass_Qty when stimes_ttl>1"
'SQL01 = SQL01 & "  and main_wc between 2000 and 3000 "
'SQL01 = SQL01 & "  and  ((trans_type='MVIN' and output_fg='-') or trans_type<>'MVIN') then Qty else 0 end) pass2_qty ,"
'SQL01 = SQL01 & "  0 as in_qty ,0 as wip_qty from "&table_name1&" Where "
''SQL01 = SQL01 & "  Fac_id='" & G_Fac &"' and trans_type <>'HOLD' "&sqlbu2& sql_m & sql_p  & StrSql_w & " Group By fac_id,main_wc union select * from a1  )   "
'SQL01 = SQL01 & "  Fac_id='" & G_Fac &"' and trans_type <>'HOLD' "&" and trans_type<>'CRFL'"&sqlbu2& sql_m & sql_p  & StrSql_w & " Group By fac_id,main_wc union select * from a1  )   "  ' 2007/9/1 U
'SQL01 = SQL01 & "  ,a3 as (  Select fac_id,to_wc as WORK_CTR,0 PASS_qty,0 totalrwk_qty,0 firstrwk_qty,0 tobescrap_qty,0 pass1_qty,0 pass2_qty,"
'SQL01 = SQL01 & "  sum( case when to_wc <2000 or to_wc >3000  then pass_Qty when to_wc between 2000 and 3000 and  ( (trans_type='MVIN' and output_fg='-') or trans_type<>'MVIN') then Qty end ) in_qty,"
''SQL01 = SQL01 & " 0 as  wip_qty from "&table_name1&" Where Fac_id='" & G_Fac &"'" &sqlbu2& sql_m & sql_p  & StrSql_w1 & " and to_wc>0 Group By fac_id,to_wc union select * from a2 )"
'SQL01 = SQL01 & " 0 as  wip_qty from "&table_name1&" Where Fac_id='" & G_Fac &"'"&" and trans_type<>'CRFL'" &sqlbu2& sql_m & sql_p  & StrSql_w1 & " and to_wc>0 Group By fac_id,to_wc union select * from a2 )"  '2007/9/1 U
'SQL01 = SQL01 & "  ,a4 as (  Select fac_id,work_ctr as WORK_CTR,0 PASS_qty,0 totalrwk_qty,0 firstrwk_qty,sum(tobescrap_qty) tobescrap_qty,0 pass1_qty,0 pass2_qty,"
''SQL01 = SQL01 & "  0 as in_qty,0 as  wip_qty from "&table_name1&" Where Fac_id='" & G_Fac &"'"&sqlbu2& sql_m & sql_p  & StrSql_w2 & " Group By fac_id,work_ctr union select * from a3 ) "     ' 2007/9/1 U
'SQL01 = SQL01 & "  0 as in_qty,0 as  wip_qty from "&table_name1&" Where Fac_id='" & G_Fac &"' and  trans_type<>'CRFL'"&sqlbu2& sql_m & sql_p  & StrSql_w2 & " Group By fac_id,work_ctr union select * from a3 ) "
'SQL01 = SQL01 & " select WORK_CTR,sum(PASS_qty ) PASS_qty,sum( totalrwk_qty) totalrwk_qty,sum(firstrwk_qty) firstrwk_qty,sum(tobescrap_qty) tobescrap_qty,sum(pass1_qty) pass1_qty,sum(pass2_qty) pass2_qty,sum(IN_QTY) IN_QTY,sum(WIP_QTY) WIP_QTY from a4 group by work_ctr order by work_ctr  "

SQL01 = " WITH a0 AS (SELECT   fac_id, work_ctr, 0 AS pass_qty, 0 totalrwk_qty,0 firstrwk_qty, 0 tobescrap_qty, 0 pass1_qty, 0 pass2_qty,0 in_qty, 0 AS WIP_QTY,SUM (qty) AS hold_wip_qty "
SQL01 = SQL01 & "  From "&table_name2
SQL01 = SQL01 & " WHERE fac_id = '" & G_Fac &"'" &sqlbu1& sql_p & StrSql_w2 & " and Acct_Date ='" & vDate_e1 & "' and work_ctr>1000  and HOLD_FLAG='Y' GROUP BY fac_id, work_ctr)"
SQL01 = SQL01 & " ,a1 as ( SELECT   fac_id, work_ctr, 0 AS pass_qty, 0 totalrwk_qty,0 firstrwk_qty, 0 tobescrap_qty, 0 pass1_qty, 0 pass2_qty,0 in_qty, SUM (qty) AS wip_qty    ,0 AS hold_wip_qty"
SQL01 = SQL01 & "  From "&table_name2
SQL01 = SQL01 & " Where Fac_ID='" & G_Fac &"'" &sqlbu1& sql_p & StrSql_w2 & " and Acct_Date ='" & vDate_e1 & "' and work_ctr>1000  Group By Fac_ID,Work_Ctr    UNION SELECT * FROM A0) "
SQL01 = SQL01 & " ,a2 AS(SELECT   fac_id, main_wc AS work_ctr,SUM (CASE WHEN main_wc < 2000 OR main_wc > 3000 THEN pass_qty"
SQL01 = SQL01 & " WHEN main_wc BETWEEN 2000 AND 3000"
SQL01 = SQL01 & " AND ((trans_type = 'MVIN' AND output_fg = '-') OR trans_type <> 'MVIN')THEN qty ELSE 0 END) pass_qty,"
SQL01 = SQL01 & " SUM(rwk_qty) totalrwk_qty,SUM (CASE WHEN stimes_ttl <= 1 THEN rwk_qty ELSE 0 END) firstrwk_qty, "
SQL01 = SQL01 & " 0 AS tobescrap_qty, SUM (CASE WHEN stimes_ttl = 0 THEN pass_qty ELSE 0 END) pass1_qty,"
SQL01 = SQL01 & "  SUM(CASE WHEN stimes_ttl > 1 AND (main_wc < 2000 OR main_wc > 3000)THEN pass_qty  WHEN stimes_ttl > 1"
SQL01 = SQL01 & " AND main_wc BETWEEN 2000 AND 3000"
SQL01 = SQL01 & " AND ((trans_type = 'MVIN' AND output_fg = '-')OR trans_type <> 'MVIN') THEN qty ELSE 0 END)pass2_qty,"
SQL01 = SQL01 & " 0 AS in_qty, 0 AS wip_qty    ,0 AS hold_wip_qty FROM "&table_name1&" WHERE"
SQL01 = SQL01 & " fac_id = '" & G_Fac &"' AND trans_type <> 'HOLD' AND trans_type <> 'CRFL'"&sqlbu2& sql_m & sql_p  & StrSql_w & " GROUP BY fac_id, main_wc UNION SELECT * FROM a1)"
SQL01 = SQL01 & " , a3 AS(SELECT   fac_id, to_wc AS work_ctr, 0 pass_qty, 0 totalrwk_qty, 0 firstrwk_qty, 0 tobescrap_qty, 0 pass1_qty, 0 pass2_qty,"
SQL01 = SQL01 & " SUM (CASE WHEN to_wc < 2000 OR to_wc > 3000 THEN pass_qty WHEN to_wc BETWEEN 2000 AND 3000 AND ((trans_type = 'MVIN' AND output_fg = '-')OR trans_type <> 'MVIN')THEN qty END) in_qty,"
SQL01 = SQL01 & " 0 AS wip_qty,0 AS hold_wip_qty FROM "&table_name1&" WHERE fac_id = '" & G_Fac &"' AND trans_type <> 'CRFL'"&sqlbu2& sql_m & sql_p  & StrSql_w1 &" AND to_wc > 0 GROUP BY fac_id, to_wc UNION SELECT * FROM a2)"
SQL01 = SQL01 & " , a4 AS(SELECT   fac_id, work_ctr AS work_ctr, 0 pass_qty, 0 totalrwk_qty,0 firstrwk_qty, SUM (tobescrap_qty) tobescrap_qty,0 pass1_qty, 0 pass2_qty, "
SQL01 = SQL01 & " 0 AS in_qty, 0 AS wip_qty  ,0 AS hold_wip_qty FROM "&table_name1&" WHERE fac_id = '" & G_Fac &"' AND trans_type <> 'CRFL'"&sqlbu2& sql_m & sql_p  & StrSql_w2 & " GROUP BY fac_id, work_ctr UNION SELECT * FROM a3)"
SQL01 = SQL01 & " SELECT   work_ctr, SUM (pass_qty) pass_qty, SUM (totalrwk_qty) totalrwk_qty, SUM (firstrwk_qty) firstrwk_qty, SUM (tobescrap_qty) tobescrap_qty,SUM (pass1_qty) pass1_qty, SUM (pass2_qty) pass2_qty, SUM (in_qty) in_qty, "
SQL01 = SQL01 & " SUM (wip_qty) wip_qty,SUM( hold_wip_qty) hold_wip_qty,SUM(wip_qty-hold_wip_qty)nhold_wip_qty FROM a4 GROUP BY work_ctr ORDER BY work_ctr"    



Response.Write "<br><br><br><br><br><br>~~ SQL01:" & SQL01 & "~~<BR>"
rs.Open SQL01,conn,3,3

cnt = 0
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  %>
<SCRIPT LANGUAGE=vbscript>         
    'Initial the page format
    window.parent.ShowMainPage
    set tmpSpan = document.all.tags("span")

sub ReportGrid1_dblClick()
    col = ReportGrid1.ColSel
    if col<>2 and col <>3 and col <>6 then exit Sub
    row = ReportGrid1.rowSel
    if ReportGrid1.TextMatrix(row,col)=0 then exit sub
    row1 = ReportGrid1.TextMatrix(row,1)
    frm.row1.value = row1
    
    if col=2 then
        frm.target ="ReportFrmB3"
        frm.action = "OperPerfDetail3.asp"
    elseif col=3 then
        frm.target ="ReportFrmB1"
        frm.action = "OperPerfDetail4.asp"
    elseif col=6 then
        frm.target ="ReportFrmB1"
        frm.action = "OperPerfDetail5.asp"
    end if
    frm.submit()
end sub
sub ReportGrid2_dblClick()
    col = ReportGrid2.ColSel
    row = ReportGrid2.rowSel
    col0 = ReportGrid2.TextMatrix(0,col)
    col1 = ReportGrid2.TextMatrix(1,col)
    row1 = ReportGrid2.TextMatrix(row,1)
    frm.col0.value = col0
    frm.col1.value = col1
    frm.row1.value = row1
    if col<6 then
        frm.target ="ReportFrmB1"
        frm.action = "OperPerfDetail1.asp"
    elseif col=6 then
        frm.target ="ReportFrmB1"
        frm.action = "OperPerfDetail4.asp"
    elseif col=7 then
        frm.target ="ReportFrmB3"
        frm.action = "OperPerfDetail2.asp"
    end if
    frm.submit()
end sub

ReportGrid1.Rows =3
ReportGrid1.Cols = 13   
ReportGrid1.Fixedcols = 2
ReportGrid1.FontSize = 9
ReportGrid1.MergeCells = 3
'ReportGrid1.FontBold = True
ReportGrid1.Row = 0
ReportGrid1.TextMatrix(0,0)=""
ReportGrid1.TextMatrix(0,1)="Operation"
ReportGrid1.TextMatrix(0,2)="Pass Q'ty"
ReportGrid1.TextMatrix(0,3)="To Rwk"
ReportGrid1.TextMatrix(0,4)="rwk/pass Rate"
ReportGrid1.TextMatrix(0,5)="to be scrap"
ReportGrid1.TextMatrix(0,6)="  WIP  "
ReportGrid1.TextMatrix(0,7)="WIP Hold "
ReportGrid1.TextMatrix(0,8)="WIP Not Hold"
ReportGrid1.TextMatrix(0,9)="  IN  "
ReportGrid1.TextMatrix(0,10)="1'st yield"
ReportGrid1.TextMatrix(0,11)="Total yield"
ReportGrid1.TextMatrix(0,12)="  修理再發率  "

For i = 1 To 10
    ReportGrid1.ColAlignment(i)  = 4 '<B>flexAlignCenterCenter</B>4儲存格內容居中、置中對齊
    ReportGrid1.ColWidth(i) = Len(ReportGrid1.TextMatrix(0,i)) * 130
Next

ReportGrid1.ColWidth(0) = 0
</script>

        
<%While Not rs.EOF and Err = 0
    m_work_ctr=cDbl(rs.Fields("work_ctr").Value)
    if m_work_ctr < 2000 then
        'operation
        rswvlhtxt1 = rs.Fields("work_ctr").Value         
        'pass q'ty
        rswvlhtxt2 = cDbl(rs.Fields("Pass_qty").Value)        
        'to rwk <------------------*Null 的使用不正確: 'cDbl'<BR>
        rswvlhtxt3 = cDbl(rs.Fields("totalrwk_qty").Value)    
        '1st pass <------------------*Null 的使用不正確: 'cDbl'<BR>
        rswvlhtxt2_1 = cDbl(rs.Fields("pass1_qty").Value)    
                if rswvlhtxt2>0 then
                    'r/w rate
            rswvlhtxt4 = FormatNumber(cDbl(rswvlhtxt3)/cDbl(rswvlhtxt2)*100,4)     
                else
            rswvlhtxt4=0
                end if
            'sent to(to be scrap)
        rswvlhtxt5 = cDbl(rs.Fields("tobescrap_qty").Value)    
        'wip
        rswvlhtxt6 = rs.Fields("wip_qty").Value    
         'wip hold
         rswvlhtxt7 = rs.Fields("hold_wip_qty").Value
         'wip not hold        
         rswvlhtxt8 = rs.Fields("nhold_wip_qty").Value
        'in
        rswvlhtxt9 = rs.Fields("in_qty").value             
        if rswvlhtxt2>0 then
            '1'st yield
            rswvlhtxt10 = FormatNumber(cDbl(rswvlhtxt2_1) /cDbl(rswvlhtxt2)*100,4)    
        else
            rswvlhtxt10=0
        end if
        response.write "<!-->>" & rswvlhtxt2_1 &"/"& rswvlhtxt2 & "=" & rswvlhtxt8 &"-->"
        if rswvlhtxt2>0 then
            'r/w rate 'total yield
            rswvlhtxt11 =FormatNumber((cDbl(rswvlhtxt2)-cDbl(rswvlhtxt3))/cDbl(rswvlhtxt2)*100,4)    
        else
            rswvlhtxt11=0
        end if
        if rswvlhtxt2>0 then
            '修理再發率
            rswvlhtxt12 =  FormatNumber(((cDbl(rswvlhtxt2)-cDbl(rswvlhtxt2_1))-cDbl(rswvlhtxt3) )/cDbl(rswvlhtxt2)*100,4)
                else
            rswvlhtxt12=0
                end if
        cnt = cnt + 1
%>
        <script language= "VBScript">
        ReportGrid1.Rows = "<%=cnt + 1%>"
        ReportGrid1.TextMatrix(<%=cnt%>,0)=""
        ReportGrid1.TextMatrix(<%=cnt%>,1)="<%=rswvlhtxt1%>"
        ReportGrid1.TextMatrix(<%=cnt%>,2)="<%=rswvlhtxt2%>"
        ReportGrid1.TextMatrix(<%=cnt%>,3)="<%=rswvlhtxt3%>"
        ReportGrid1.TextMatrix(<%=cnt%>,4)="<%=rswvlhtxt4%>"
        ReportGrid1.TextMatrix(<%=cnt%>,5)="<%=rswvlhtxt5%>"
        ReportGrid1.TextMatrix(<%=cnt%>,6)="<%=rswvlhtxt6%>"
        ReportGrid1.TextMatrix(<%=cnt%>,7)="<%=rswvlhtxt7%>"
        ReportGrid1.TextMatrix(<%=cnt%>,8)="<%=rswvlhtxt8%>"
        ReportGrid1.TextMatrix(<%=cnt%>,9)="<%=rswvlhtxt9%>"
        ReportGrid1.TextMatrix(<%=cnt%>,10)="<%=rswvlhtxt10%>"
        ReportGrid1.TextMatrix(<%=cnt%>,11)="<%=rswvlhtxt11%>"
        ReportGrid1.TextMatrix(<%=cnt%>,12)="<%=rswvlhtxt12%>"
        For i = 1 To 12
            If ReportGrid1.TextMatrix(<%=cnt%>,i) <> "" And ReportGrid1.ColWidth(i) < Len(ReportGrid1.TextMatrix(<%=cnt%>,i)) * 180 Then
                ReportGrid1.ColWidth(i) = Len(ReportGrid1.TextMatrix(<%=cnt%>,i)) * 180
            End If
        Next
        </script>             
<%
    end if
    rs.MoveNext
Wend
%>
</script>     
<SCRIPT LANGUAGE=vbscript>
ReportGrid2.Rows = 3
ReportGrid2.Cols = 10
ReportGrid2.FixedRows = 2  
ReportGrid2.Fixedcols = 2
ReportGrid2.FontSize = 9
ReportGrid2.MergeCells = 3
'ReportGrid2.FontBold = True
ReportGrid2.Row = 1
ReportGrid2.TextMatrix(0,1)="Operation"
ReportGrid2.TextMatrix(0,2)="  In  "
ReportGrid2.TextMatrix(0,3)="  Out  "
ReportGrid2.TextMatrix(0,4)="  Out  "
ReportGrid2.TextMatrix(0,5)="  Out  "
ReportGrid2.TextMatrix(0,6)="To be scrap"
ReportGrid2.TextMatrix(0,7)="  Wip  "
ReportGrid2.TextMatrix(0,8)="  Wip  "
ReportGrid2.TextMatrix(0,9)="  Wip  "
ReportGrid2.TextMatrix(1,1)="Operation"
ReportGrid2.TextMatrix(1,2)="  In  "
ReportGrid2.TextMatrix(1,3)=" rework "
ReportGrid2.TextMatrix(1,4)="rework(1)以上"
ReportGrid2.TextMatrix(1,5)=" rate "
ReportGrid2.TextMatrix(1,6)="To be scrap"
ReportGrid2.TextMatrix(1,7)=" WIP "
ReportGrid2.TextMatrix(1,8)="Wip Hold"
ReportGrid2.TextMatrix(1,9)="not hold"
ReportGrid2.MergeCol(0)= True
'ReportGrid2.MergeCol(1)= True
'ReportGrid2.MergeCol(2)= True
'ReportGrid2.MergeCol(6)= True
'ReportGrid2.MergeCol(7)= True
ReportGrid2.MergeRow(0)= True
ReportGrid2.MergeRow(1)= True
     
For i = 1 To 9
    ReportGrid2.ColAlignment(i)  = 4 '<B>flexAlignCenterCenter</B>4儲存格內容居中、置中對齊
    ReportGrid2.ColWidth(i) = Len(ReportGrid2.TextMatrix(0,i)) * 180
    ReportGrid2.ColWidth(i) = Len(ReportGrid2.TextMatrix(1,i)) * 180
Next
ReportGrid2.ColWidth(0) = 0

<%      
cnt = 1
cn = 0
rewor = ""
rs.Movefirst
While Not rs.EOF and Err = 0
    m_work_ctr=cDbl(rs.Fields("work_ctr").Value)
    if m_work_ctr > 2000 and m_work_ctr<3000 then
        'operation
        rswvlhtxt1 = rs.Fields("work_ctr").Value
        'pass q'ty
        rswvlhtxt2 = cDbl(rs.Fields("Pass_qty").Value)      
        'to rwk <------------------*Null 的使用不正確: 'cDbl'<BR>
        rswvlhtxt3 = cDbl(rs.Fields("totalrwk_qty").Value)  
        '2st pass <------------------*Null 的使用不正確: 'cDbl'<BR>
        rswvlhtxt2_2 = cDbl(rs.Fields("pass2_qty").Value)   
        if rswvlhtxt2>0 then
            'r/w rate
            rswvlhtxt4 = FormatNumber(cDbl(rswvlhtxt3)/cDbl(rswvlhtxt2),4)
                else
            rswvlhtxt4=0
                end if
            'sent to(to be scrap)
        rswvlhtxt5 = cDbl(rs.Fields("tobescrap_qty").Value)  
        'wip
        rswvlhtxt6 = rs.Fields("wip_qty").value  
        'in
        rswvlhtxt7 = rs.Fields("in_qty").value  
        if rswvlhtxt2>0 then
            '2'st yield
            rswvlhtxt8 = FormatNumber(cDbl(rswvlhtxt2_2) /cDbl(rswvlhtxt2)*100,4)
        else
            rswvlhtxt8=0
        end if
        rswvlhtxt9=rs.Fields("hold_wip_qty").value  
        rswvlhtxt10=rs.Fields("nhold_wip_qty").value  
        cnt = cnt + 1
%>

        ReportGrid2.Rows = "<%=cnt + 1%>"
        ReportGrid2.TextMatrix(<%=cnt%>,0)=""
        ReportGrid2.TextMatrix(<%=cnt%>,1)="<%=rswvlhtxt1%>"
        ReportGrid2.TextMatrix(<%=cnt%>,2)="<%=rswvlhtxt7%>"
        ReportGrid2.TextMatrix(<%=cnt%>,3)="<%=rswvlhtxt2%>"
        ReportGrid2.TextMatrix(<%=cnt%>,4)="<%=rswvlhtxt2_2%>"
        ReportGrid2.TextMatrix(<%=cnt%>,5)="<%=rswvlhtxt8 %>"
        ReportGrid2.TextMatrix(<%=cnt%>,6)="<%=rswvlhtxt5%>"
        ReportGrid2.TextMatrix(<%=cnt%>,7)="<%=rswvlhtxt6%>"
        ReportGrid2.TextMatrix(<%=cnt%>,8)="<%=rswvlhtxt9%>"
        ReportGrid2.TextMatrix(<%=cnt%>,9)="<%=rswvlhtxt10%>"
        For i = 1 To 9
            If ReportGrid2.TextMatrix(<%=cnt%>,i) <> "" And ReportGrid2.ColWidth(i) < Len(ReportGrid2.TextMatrix(<%=cnt%>,i)) * 180 Then
                ReportGrid2.ColWidth(i) = Len(ReportGrid2.TextMatrix(<%=cnt%>,i)) * 180
            End If
        Next
<%    end if
    rs.MoveNext
    Wend
    'rework= left(rework, Len(rework)-1)    
%>
-->
</SCRIPT>
<form name="frm" method="post" >
<input type="hidden" name="G_FAC" value=<%=G_FAC%>>
<input type="hidden" name="StrSql_w2" value="<%=StrSql_w2%>">
<input type="hidden" name="StrSql_w1" value="<%=StrSql_w1%>">
<input type="hidden" name="StrSql_w" value="<%=StrSql_w4%>">
<input type="hidden" name="col0">
<input type="hidden" name="col1">
<input type="hidden" name="row0">
<input type="hidden" name="row1">
<input type="hidden" name="sql_p" value="<%=sql_p%>">
<input type="hidden" name="sql_m" value="<%=sql_m%>">
<input type="hidden" name="sqlbu1" value="<%=sqlbu1%>">
<input type="hidden" name="sqlbu2" value="<%=sqlbu2%>">
<input type="hidden" name="vdate_s" value="<%=vdate_s%>">
<input type="hidden" name="vdate_e" value="<%=vdate_e1%>">
</form>
<SCRIPT LANGUAGE=vbscript>
Sub ReportGrid1_Print()
    MyTitle = "<%=GridTitle1%>"
    orientation = 1
    print_grid_2 ReportPrint1, ReportGrid1, MyTitle,now
End Sub
Sub ReportGrid2_Print()
    MyTitle = "<%=GridTitle2%>"
    orientation = 1
    print_grid_2 ReportPrint1, ReportGrid2, MyTitle,now
End Sub
</SCRIPT>
</BODY>
</HTML>


从第一大段传值到第2大段传不了啊,有没有人帮忙啊~呜~~
搜索更多相关主题的帖子: FAC help ASP 
2008-05-09 15:05
快速回复:ASP高手啊~~help~~
数据加载中...
 
   



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

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