日报表解释说明(2)

2019-08-30 23:40

For i = 1 To oRs.RecordCount

MSFlexGrid1.TextMatrix(i + 1, 0) = i Next

If (n > 0) Then

oRs.MoveFirst i = 0

End If 【显示编号下方的信息为从第2行、第0列为1,第3行第0列为2,i的取值为从1到查询到的数目oRs.RecordCount】 Do While Not oRs.EOF

n = n + 1

ylp = Int(ylp * 10 ^ 3 + 0.5) / (10 ^ 3)

wdp = Int(wdp * 10 ^ 3 + 0.5) / (10 ^ 3) llp = Int(llp * 10 ^ 3 + 0.5) / (10 ^ 3) zlp = Int(zlp * 10 ^ 3 + 0.5) / (10 ^ 3) dyp = Int(dyp * 10 ^ 3 + 0.5) / (10 ^ 3) sdp = Int(sdp * 10 ^ 3 + 0.5) / (10 ^ 3) i = i + 1

'MSFlexGrid1.AddItem i,i+1

t = CStr(oRs.Fields(0).Value) If e = f Then

MSFlexGrid1.TextMatrix(i + 1, 1) = Mid(t, 11, 16) End If

If e <> f Then

MSFlexGrid1.TextMatrix(i + 1, 1) = t End If

a1 = CStr(oRs.Fields(1).Value) b1 = CStr(oRs.Fields(2).Value) c1 = CStr(oRs.Fields(3).Value) d1 = CStr(oRs.Fields(4).Value) e1 = CStr(oRs.Fields(5).Value) f1 = CStr(oRs.Fields(6).Value)

a1 = Int(a1 * 10 ^ 3 + 0.5) / (10 ^ 3) b1 = Int(b1 * 10 ^ 3 + 0.5) / (10 ^ 3) c1 = Int(c1 * 10 ^ 3 + 0.5) / (10 ^ 3) d1 = Int(d1 * 10 ^ 3 + 0.5) / (10 ^ 3) e1 = Int(e1 * 10 ^ 3 + 0.5) / (10 ^ 3) f1 = Int(f1 * 10 ^ 3 + 0.5) / (10 ^ 3) MSFlexGrid1.TextMatrix(i + 1, 2) = a1 MSFlexGrid1.TextMatrix(i + 1, 3) = b1 MSFlexGrid1.TextMatrix(i + 1, 4) = c1 MSFlexGrid1.TextMatrix(i + 1, 5) = d1 MSFlexGrid1.TextMatrix(i + 1, 6) = e1 MSFlexGrid1.TextMatrix(i + 1, 7) = f1

MSFlexGrid1.TextMatrix(oRs.RecordCount + 3, 2) = yld MSFlexGrid1.TextMatrix(oRs.RecordCount + 4, 2) = ylx MSFlexGrid1.TextMatrix(oRs.RecordCount + 5, 2) = ylp MSFlexGrid1.TextMatrix(oRs.RecordCount + 3, 3) = wdd MSFlexGrid1.TextMatrix(oRs.RecordCount + 4, 3) = wdx MSFlexGrid1.TextMatrix(oRs.RecordCount + 5, 3) = wdp MSFlexGrid1.TextMatrix(oRs.RecordCount + 3, 4) = lld MSFlexGrid1.TextMatrix(oRs.RecordCount + 4, 4) = llx MSFlexGrid1.TextMatrix(oRs.RecordCount + 5, 4) = llp

'************************************************* MSFlexGrid1.TextMatrix(oRs.RecordCount + 3, 5) = zld MSFlexGrid1.TextMatrix(oRs.RecordCount + 4, 5) = zlx MSFlexGrid1.TextMatrix(oRs.RecordCount + 5, 5) = zlp MSFlexGrid1.TextMatrix(oRs.RecordCount + 3, 6) = dyd MSFlexGrid1.TextMatrix(oRs.RecordCount + 4, 6) = dyx MSFlexGrid1.TextMatrix(oRs.RecordCount + 5, 6) = dyp MSFlexGrid1.TextMatrix(oRs.RecordCount + 3, 7) = sdd MSFlexGrid1.TextMatrix(oRs.RecordCount + 4, 7) = sdx MSFlexGrid1.TextMatrix(oRs.RecordCount + 5, 7) = sdp '*****************************************************

oRs.MoveNext Loop

End Sub

3 打印按钮

Sub OnClick(ByVal Item) Dim ExcelApp Dim ExcelBook Dim ExcelSheet Dim MSFlexGrid1 Dim i,irow,ICOL Dim z,k

Set MSFlexGrid1 = ScreenItems(\Set ExcelApp = CreateObject(\Set ExcelBook = ExcelApp.Workbooks.Add Set ExcelSheet = ExcelBook.Worksheets(1) ExcelApp.Visible = True

ExcelSheet.Range(\

For irow = 0 To MSFlexGrid1.Rows - 1 For ICOL = 0 To MSFlexGrid1.Cols - 1 z=MSFlexGrid1.Rows

ExcelSheet.Cells(irow + 1,icol+1)=Trim(MSFlexGrid1.TextMatrix(irow, icol)) Next Next

ExcelSheet.Range( \ExcelSheet.Range( \ExcelSheet.Range( \ExcelSheet.Range( \ExcelSheet.Rows(1).RowHeight = 0.75/0.035 ExcelSheet.Cells.EntireColumn.AutoFit ExcelSheet.Rows(1).Font.Name = \宋体\ExcelSheet.Rows(1).Font.Bold = True ExcelSheet.Rows(1).Font.Size = 16

ExcelSheet.Cells.HorizontalAlignment =3 'ExcelSheet.PageSetup.TopMargin = 2/0.035 'ExcelSheet.PageSetup.BottomMargin = 2/0.035 'ExcelSheet.PageSetup.LeftMargin = 2/0.035 'ExcelSheet.PageSetup.RightMargin = 2/0.035

ExcelSheet.PageSetup.CenterHorizontally = 2/0.035 ExcelSheet.printpreview'打印阅览 'ExcelSheet.PrintOut'打印时用此句 ExcelBook.Close ExcelApp.Quit

Set ExcelApp = Nothing End Sub

4 画面函数 打开画面

Sub OnOpen() Dim Text1,Text2

Set Text1 = ScreenItems(\Set Text2 = ScreenItems(\Text1.Text=Now Text2.Text=0 End Sub


日报表解释说明(2).doc 将本文的Word文档下载到电脑 下载失败或者文档不完整,请联系客服人员解决!

下一篇:研究生学术英语写作教程Unit 3 Reviewing Literature

相关阅读
本类排行
× 注册会员免费下载(下载后可以自由复制和排版)

马上注册会员

注:下载文档有可能“只有目录或者内容不全”等情况,请下载之前注意辨别,如果您已付费且无法下载或内容有问题,请联系我们协助你处理。
微信: QQ: