http://www.sufeinet.com/plugin.php?id=keke_group

苏飞论坛

 找回密码
 马上注册

QQ登录

只需一步,快速开始

分布式系统框架(V2.0) 轻松承载百亿数据,千万流量!讨论专区 - 源码下载 - 官方教程

HttpHelper爬虫框架(V2.7-含.netcore) HttpHelper官方出品,爬虫框架讨论区 - 源码下载 - 在线测试和代码生成

HttpHelper爬虫类(V2.0) 开源的爬虫类,支持多种模式和属性 源码 - 代码生成器 - 讨论区 - 教程- 例子

查看: 2800|回复: 1

[咨询站长] asp 问题

[复制链接]
发表于 2014-5-13 15:45:01 | 显示全部楼层 |阅读模式
50金钱
本帖最后由 tt0501 于 2014-5-13 15:49 编辑

Sub GetExcelFileForDailyReport()
                        
                        'Session.CodePage = 950
                        'Response.Charset = "big5"                                       
                        
                        Server.ScriptTimeout=600
                 
                        Dim SQL, Rs, fso
                        Dim filename, filepath, act
                        Dim ProductDate, IntervalId, Line, Moldel, LotNo, Brand, ReasonCategory, Remark, ProductTime, ManHour, PerHourQty, GoalQty, ActQty, QtyPercent,  LostManHour, LostHourPercent
                        Dim strFilename, s, f, intFilelength        
                        Dim rptStartDate, rptEndDate
                        
                        rptStartDate = R_Date(Request.Form("rptStartDate"), 0)
                        rptEndDate = R_Date(Request.Form("rptEndDate"),0)
                        If rptStartDate > rptEndDate Then
                                ShowErrorMessage("The start date must be smaller than the deadline!")
                                Response.End
                        End If
                        
                        Application("OutExcelSQL")  = " SELECT * FROM Product_DailyReport_WorkOrder_View WHERE DATE = N'" & rptStartDate & "'  "
                        'Response.Write(Application("OutExcelSQL"))
                        'Response.End
                        
                  If Request.Form("btnOutExcelII") <> ""  then
                          If Application("OutExcelSQL") <> "" then
                          
                          Set Rs = Server.CreateObject("ADODB.RecordSet")
                          Rs.Open  Application("OutExcelSQL"), gew, 1, 1
                                
                                '沒有找到數據則提示并返回
                                If Rs.Eof Then
                                        ShowErrorMessage("Sorry, No Data!")
                                        Response.End
                                End If               
               
                          filename = "GewProductReport(" & R_Date(Now,3) & ").xls"
                          set fso = CreateObject("Scripting.FileSystemObject")
                          filepath = Server.MapPath("excel/"&filename)
                          'Response.Write(filepath)
                          'Response.End
                          Application("filepath") = filepath
                          Set act = fso.CreateTextFile(filepath, true)
               
                      act.WriteLine("<!DOCTYPE html PUBLIC ""-//W3C//DTD XHTML 1.0 Strict//EN"" ""http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"">")
                          act.WriteLine("<html  xmlns=""http://www.w3.org/1999/xhtml"" xml:lang=""zh-TW"">")
                          act.WriteLine("<head><meta http-equiv=""content-type"" content=""text/html; charset=Big5"" /></head>")
                          act.Writeline("<body>")
                          act.Writeline("<TABLE border=1>")
                          act.Writeline("<TR>")
                          act.Writeline("<TD colspan=20 align=right style=font-size:14px;font-weight:bold>原因代碼:A</TD>")  
                          act.Writeline("</TR> ")                                            
                          act.Writeline("<TR>")
                          act.Writeline("<TD colspan=15 align=center style=font-size:22px;font-weight:bold>生產</TD>")  
                          act.Writeline("<TD colspan=3 align=center style=font-size:22px;font-weight:bold>Production Date:"& rptStartDate &"</TD>")  
                          act.Writeline("<td colspan=2></td>")
                          act.Writeline("</TR> ")                          
                          act.Writeline("<TR>")
                          act.Writeline("<TD RowSpan=2>LINE</TD>")
                          act.Writeline("<TD RowSpan=2>MODEL</TD>")
                          act.Writeline("<TD RowSpan=2>GEW MODEL</TD>")
                          act.Writeline("<TD RowSpan=2>BRAND</TD>")
                          act.Writeline("<TD RowSpan=2>LOT NO</TD>")
                          act.Writeline("<TD RowSpan=2>LOT QTY</TD>")
                          act.Writeline("<TD Colspan=3>DAILY PRODUCTION</TD>")
                          act.Writeline("<TD Colspan=3>Subtotal DAILY PRODUCTION</TD>")
                          act.Writeline("<TD Colspan=3>TOTAL QTY per LOT</TD>")                  
                          act.Writeline("<TD RowSpan=2>BALANCE</TD>")
                          act.Writeline("<TD RowSpan=2>人數</TD>")        
                          act.Writeline("<TD RowSpan=2>原因代碼</TD>")
                          act.Writeline("<TD RowSpan=2>備註</TD>")                        
                          act.Writeline("<TD RowSpan=2>日期</TD>")
                          act.Writeline("</TR> ")        
                          act.Writeline("<TR>")
                          act.Writeline("<TD>A.M.</TD>")
                          act.Writeline("<TD>P.M.</TD>")
                          act.Writeline("<TD>O.T.</TD>")
                          act.Writeline("<TD>PASS</TD>")
                          act.Writeline("<TD>REJ</TD>")
                          act.Writeline("<TD>IN PRD</TD>")
                          act.Writeline("<TD>COMPL</TD>")
                          act.Writeline("<TD>IN PRD</TD>")
                          act.Writeline("<TD>IN STORE</TD>")
                          act.Writeline("</TR> ")                          
               
                          While Not Rs.EOF
                          
                                                ProductDate         = RemoveHtml(Rs("date"))
                                                ProlineId    = RemoveHtml(Rs("prolineId"))
                                                Model = RemoveHtml(Rs("productId"))                                                
                                                Brand = RemoveHtml(Rs("Name"))
                                                GewModel = RemoveHtml(Rs("GewModel"))                        
                                                LotNo   = RemoveHtml(Rs("approve_no"))
                                                LotQty = RemoveHtml(Rs("approve_amount"))
                                                AMQty = GewIntervalProQty(rptStartDate, ProlineId, LotNo, "AM")
                                                PMQty = GewIntervalProQty(rptStartDate, ProlineId, LotNo, "PM")
                                                OTQty = GewIntervalProQty(rptStartDate, ProlineId, LotNo, "OT")        
                                                ManHour = GewLineManHour(rptStartDate, ProlineId)
                                                COMPL = GewCompleteProQty(rptStartDate, LotNo)

                                                PASS = RemoveHtml(Rs("Pass_QTY"))
                                                REJ = RemoveHtml(Rs("Rej_QTY"))
                                                INPRD = RemoveHtml(Rs("Inprd_QTY"))
                                                INSTORE = RemoveHtml(Rs("Cominstore_QTY"))
                                                ReasonCode = RemoveHtml(Rs("Reason_Code"))
                                                Remarks = RemoveHtml(Rs("Re_marks"))
                                                CominprdQTY = RemoveHtml(Rs("Cominprd_QTY"))

                                                
                                                TotalAMQty = TotalAMQty + AMQty
                                                TotalPMQty = TotalPMQty + PMQty
                                                TotalOTQty = TotalOTQty + OTQty
                                                TotalManHour = TotalManHour + ManHour
                                                               
                                        act.WriteLine("<TR>")
                                        act.WriteLine("<TD align=center>"        & ProlineId & "</TD>")
                                        act.WriteLine("<TD align=center>"        & Model & "</TD>")
                                        act.WriteLine("<TD align=center>"        & GewModel & "</TD>")
                                        act.WriteLine("<TD align=center>"        & Brand & "</TD>")
                                        act.WriteLine("<TD align=center>"        & LotNo & "</TD>")
                                        act.WriteLine("<TD align=center> "        & LotQty & "</TD>")        
                                        act.WriteLine("<TD align=center>"        & AMQty & "</TD>")                                       
                                        act.WriteLine("<TD align=center>"        & PMQty        & "</TD>")
                                        act.WriteLine("<TD align=center>"        & OTQty & "</TD>")
                                        act.WriteLine("<TD align=center> "   & PASS &  " </TD>")        
                                        act.WriteLine("<TD align=center>"& REJ &"</TD>")
                                        act.WriteLine("<TD align=center>"& INPRD &"</TD>")        
                                        act.WriteLine("<TD align=center>"        & COMPL &"</TD>")                        
                                        act.WriteLine("<TD align=center>"& INSTORE &"</TD>")        
                                        act.WriteLine("<TD align=center>"& CominprdQTY&"</TD>")
                                        act.WriteLine("<TD align=center> </TD>")
                                        act.WriteLine("<TD align=center>" & ManHour & "</TD>")
                                        act.WriteLine("<TD align=center>"& ReasonCode &"</TD>")
                                        act.WriteLine("<TD align=center>"& Remarks &"</TD>")
                                        act.WriteLine("<TD align=center> </TD>")
                                        act.WriteLine("</TR>")
               
                          Rs.MoveNext
                          Wend
                          
                                          act.WriteLine("<TR style=font-weight:bold>")
                                        act.WriteLine("<TD Colspan=6> </TD>")
                                        act.WriteLine("<TD align=center>"        & TotalAMQty & "</TD>")
                                        act.WriteLine("<TD align=center>"        & TotalPMQty & "</TD>")
                                        act.WriteLine("<TD align=center>"        & TotalOTQty & "</TD>")
                                        act.WriteLine("<TD align=center> </TD>")        
                                        act.WriteLine("<TD align=center> </TD>")
                                        act.WriteLine("<TD align=center> </TD>")        
                                        act.WriteLine("<TD align=center> </TD>")                        
                                        act.WriteLine("<TD align=center> </TD>")        
                                        act.WriteLine("<TD align=center> </TD>")
                                        act.WriteLine("<TD align=center> </TD>")
                                        act.WriteLine("<TD align=center>" & TotalManHour & "</TD>")
                                        act.WriteLine("<TD align=center> </TD>")
                                        act.WriteLine("<TD align=center> </TD>")
                                        act.WriteLine("<TD align=center> </TD>")
                                        act.WriteLine("</TR>")
                          
                          Rs.close
                          Set Rs = Nothing
                          act.WriteLine("</table></body></html>")
                          act.close

  • ADODB.Recordset (0x800A0CC1)
    在对应所需名称或序数的集合中,未找到项目。
    /AppProline/proline.asp, 第 2336 行



PASS = RemoveHtml(Rs("Pass_QTY"))                                                REJ = RemoveHtml(Rs("Rej_QTY"))                                               
INPRD = RemoveHtml(Rs("Inprd_QTY"))                                               
INSTORE = RemoveHtml(Rs("Cominstore_QTY"))                                          
  ReasonCode = RemoveHtml(Rs("Reason_Code"))                                            
  Remarks = RemoveHtml(Rs("Re_marks"))                                               
CominprdQTY = RemoveHtml(Rs("Cominprd_QTY"))
就是这里  我刚加的 为什么会找不到    我 SQL表 里面 名字没错












1. 开通SVIP会员,免费下载本站所有源码,不限次数据,不限时间
2. 加官方QQ群,加官方微信群获取更多资源和帮助
3. 找站长苏飞做网站、商城、CRM、小程序、App、爬虫相关、项目外包等点这里
发表于 2014-5-13 16:00:46 | 显示全部楼层
不懂asp,帮你顶一下,分给这么高?
回复

使用道具 举报

您需要登录后才可以回帖 登录 | 马上注册

本版积分规则

QQ|手机版|小黑屋|手机版|联系我们|关于我们|广告合作|苏飞论坛 ( 豫ICP备18043678号-2)

GMT+8, 2024-4-29 21:53

© 2014-2021

快速回复 返回顶部 返回列表