《陈寒清WINCC视频教程报表脚本-打开画面显示当天数据.docx》由会员分享,可在线阅读,更多相关《陈寒清WINCC视频教程报表脚本-打开画面显示当天数据.docx(5页珍藏版)》请在优知文库上搜索。
1、I.在直面的点件其它二.瞄开片面trw中圣立捏序t见下面程序卜2.MBm包南屋时照源芯市密寄NAPdM.pdl瓯色A收的或WEP-年目V啦喇.缥,.VbYteiIow莅叱她.山yiMagema徉虹”BTL004HtHJQRj-rt21“:LS算SSLE力虹CeXLQl:Qi.DAdrCnlriz总工白I二.JKtfaCcELInckn8m,卫72JT2E登曲当天全部左提,为扁城5CTSFI2KGIIdI51tmmms:I.M广系U土老小IlXLI-百口片IxrnnIEceinTTr-YcviiinSFAii7hqijG4;uu-.1.wxiIK-DirrimrYcmrTiE卜E&RiyMp1E
2、tS6LocaIygumneI,SLocaiEndnw6.店面油内容睾就应款堆互3列鬲内容郛云向,一与用面而-娶却SJ烫-,”二X二史Jl%t在E称.七M泊M行acn*-.迂JUr导效招痂我乞*ftjs-o&SetcoraCtm:+Dt;RerIr-rrconn.ConnectonStreg-stcncon.QirsoxLccaion-xoce.GsenJ三cR三CxtOorJlQCoa-CLjL11.二4”,oCc3.CcandTvpe三1Su:QUeAMtae二og-8=qscCca.CcsBaAciTcxcM:“53案,ScoRji三GCCS.Cx6Kfto.ft三eordCount11
3、AH5.A=二OiTSUXiLLM.Tago(:-IWxLCn运人在.iftW由住MSFiexSrdl.ClearMS11ox:.BowecDa.RonrKcur-,fr-r-.叶E3!r、:/一JTrSrwK8rIdt(i4L(k-1?1-WSFtXLd/.rl:,一才一 二冤堂NiLJrH,二5 xtp-所X$ridl.CcLVl*1::!CF【j-一.力EHin召一,:wjzm.,IUvlhiftrI二aI-SetoCom=Creat&Obiect(ADODBrCommandF)-DConrkCoEmaridTite-1,lSetOCom.ActiveConnetiononn.oComi
4、,CommandText=si,执行检索功能*SetoRs=oCom.EKecuten=oRs.RecordCount获得检索到的总数,1HMIRuntirn己Tag名(J3).WitEn.,定义在线表格属性.MSFIcxGridLCIearMSFIeGrldl.Row莒二aRs.RecorefCount+2-MSFIexGridl.CalWidth)=700,第一列宽度设置.MSFIej(Gridl3Width俨IODO.MSFkxGHdlolWidth(2)=3300.MSFxGridl.ColWidth31=2500-MSF1exGridlolWidth(4)=2200-MSHexGri
5、dirolWidth51=2950等6列施度设比方果列数多叫维续添力WMSFIexGridLRowHeight(O)=GOO端一行高度设置.MSFxGridl.RowHeight(I)=400-MSFIexGridIrRow=0.orz=0To5限据上面的列数改变.MSFIexGridl.CeIFontSize=12r字体大小.M纤IGridLC仁卜MSFiexGridIT&xtL工件信息统计声:Mext-MSFIexGHdLMergeCells=4,相同内容合并用,元眸MsFIexGridLWLerEeRcwfO)=True1合并单元格.M5FIexGridI.Row=kForz=OTo5根
6、据上面的列数改变时MSFIexGndLCoI=LMSFIexGNdLCellB3dcCcJQUYbQaH,定七第二行猷色.Mext-MSF1exGndl.Te!0)ThenORsWoveFirst,移动到数据库检索结果的第一行i=0DoWhileNotoRs.EOFn=n+1MSFIexGridl.TetMatrix(i+2,0)=i根据上面实际情况输入MSFIexGridl.TextMatrix(i+2,l)=oRs.Fields(0).ValueMSFIexGridl.TextMatrix(i+2,2)=oRs.Fields.ValueMSFIexGridl.TextMatrix(i+2,
7、3)=ORS.Fields.ValueMSFIexGridl.TextMatrix(i+2,4)=ORS.Fields.ValueMSFIexGridl.TextMatrix(i+2z5)=oRs.Fields(4).ValueMSFIexGridl.TetMatrix(i+2z6)=oRs.Fields(5).ValueMSFleXGridLTeXtMatriX(i+2,7)=oRs.Fields(6).Valuei=i+loRs.MoveNext1.oopconn.CloseMSFIexGridl.TopRow=MSFIexGridl.TopRow-移动到最后一行EISeMSgBoX“您所查询的时间段内没有数据oRs.Requeryconn.CloseEndIf