📄 datareport1.dsr
字号:
VERSION 5.00
Begin {78E93846-85FD-11D0-8487-00A0C90DC8A9} DataReport1
Bindings = "DataReport1.dsx":0000
Caption = "DataReport1"
ClientHeight = 11115
ClientLeft = 60
ClientTop = 345
ClientWidth = 15240
StartUpPosition = 3 'Windows Default
_ExtentX = 26882
_ExtentY = 19606
_Version = 393216
_DesignerVersion= 100684101
ReportWidth = 13590
BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851}
Name = "Arial"
Size = 8.25
Charset = 0
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
GridX = 1
GridY = 1
LeftMargin = 10
RightMargin = 10
TopMargin = 10
BottomMargin = 1440
DataMember = "cmd1"
NumSections = 5
SectionCode0 = 1
BeginProperty Section0 {1C13A8E0-A0B6-11D0-848E-00A0C90DC8A9}
_Version = 393216
Name = "Section4"
Object.Height = 360
NumControls = 0
EndProperty
SectionCode1 = 2
BeginProperty Section1 {1C13A8E0-A0B6-11D0-848E-00A0C90DC8A9}
_Version = 393216
Name = "Section2"
Object.Height = 360
NumControls = 0
EndProperty
SectionCode2 = 4
BeginProperty Section2 {1C13A8E0-A0B6-11D0-848E-00A0C90DC8A9}
_Version = 393216
Name = "Section1"
Object.Height = 1440
NumControls = 0
EndProperty
SectionCode3 = 7
BeginProperty Section3 {1C13A8E0-A0B6-11D0-848E-00A0C90DC8A9}
_Version = 393216
Name = "Section3"
Object.Height = 360
NumControls = 0
EndProperty
SectionCode4 = 8
BeginProperty Section4 {1C13A8E0-A0B6-11D0-848E-00A0C90DC8A9}
_Version = 393216
Name = "Section5"
Object.Height = 360
NumControls = 0
EndProperty
End
Attribute VB_Name = "DataReport1"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Private Sub DataReport_Initialize()
Dim AdoCon1 As New ADODB.Connection
Const iW = 3 '缇,误差调整
'Dareportwwg.ReportWidth = Printer.Width - Dareportwwg.LeftMargin - Dareportwwg.RightMargin - iW
Dim AdoRec1 As New ADODB.Recordset
Dim txt As New Collection
Dim ctl As Object
Dim ctl1 As Object
AdoCon1.Open connectstring
AdoCon1.CursorLocation = adUseClient
AdoRec1.Open "select * from hetong ", AdoCon1
'Set AdoRec = AdoCon.Execute("select * from bbsk")
Set DataReport1.DataSource = AdoRec1
For Each ctl1 In Me.Sections.Item("Section2").Controls
If TypeName(ctl1) = "RptLabel" Then
Select Case ctl1.Name
Case "Label21"
ctl1.Caption = "起始时间:" & starttime
Case "Label23"
ctl1.Caption = "截至时间:" & endtime
End Select
End If
Next
For Each ctl In Me.Sections.Item("Section1").Controls
If TypeName(ctl) = "RptTextBox" Then
Select Case ctl.Name
Case "Text1"
ctl.DataField = AdoRec1.Fields("xm").Name
Case "Text2"
ctl.DataField = AdoRec1.Fields("bqzs").Name
Case "Text3"
ctl.DataField = AdoRec1.Fields("ydbq").Name
Case "Text4"
'ctl.DataField = AdoRec.Fields("ydbl").Name
Case "Text5"
'ctl.DataField = AdoRec.Fields("ltbq").Name
Case "Text6"
' ctl.DataField = AdoRec.Fields("ltbl").Name
Case "Text7"
'ctl.DataField = AdoRec.Fields("dxbq").Name
Case "Text8"
'ctl.DataField = AdoRec.Fields("dxbl").Name
Case "Text9"
'ctl.DataField = AdoRec.Fields("wtbq").Name
Case "Text10"
'ctl.DataField = AdoRec.Fields("wtbl").Name
Case "Text11"
'ctl.DataField = AdoRec.Fields("qtbq").Name
Case "Text12"
' ctl.DataField = AdoRec.Fields("qtbl").Name
End Select
End If
Next
End Sub
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -