- 21
- 0
- 约1.52万字
- 约 18页
- 2017-06-10 发布于河南
- 举报
VB中水晶报表使用(国外英文资料)
VB中水晶报表使用(国外英文资料)
The first step:
In the VB Project, the Project menu adds Add Crystal Report 9 and the Report name is used by default. Then Form2 (the Form that Crystal Rerport automatically adds, assuming it is called Form2) is automatically assigned the following code:
Option Explicit
Dim Report as New Cystal1
Private Sub Form_Load ()
Screen. MousePointer = vbHourglass calls the crystal report with the mouse in the hourglass
The value of this statement will be modified later in the crviewer90.reportsource = Report
CRViewer91 ViewReport
Screen. MousePointer = vbDefault calls the crystal report to the default shape
End Sub
Private Sub Form_Resize ()
CRViewer91. Top = 0
CRViewer91. Left = 0
CRViewer91. Height = ScaleHeight
CRViewer91. Width = ScaleWidth
End Sub
Step two:
Click the database field in the Crystal Report designer, and select database expert... , then click create new connections, and then point only field definition, to create database definition file, the field name and width is consistent with the original database table. Finally, the corresponding fields are obtained in the database field, placed on the report, and configured as required by the crystal report.
Step 3:
This step is critical, adding a Modual to the project file, defining the global ADODB variable, and implementing the dynamic connection of the database and the crystal reports. The code is as follows:
Public conn As New ADODB. Connection
Public rs As New ADODB. You
Step 4:
For ADO database connection considerations for VB programs, see the print button routines below.
Private Sub Command1_Click ()
Dim connstr As String
If conn. State = adStateOpen Then conn
Connstr = Provider = Microsoft. Jet.oledb.4.0; Data Source = app.path \ prtest.mdb; Persist Security Info = False prtest.mdb is the test Access database for the current directory of the program
Conn. The ConnectionString = connstr
Conn. Open
Conn. CursorLocation = adUseClient
If rs. State = adStateOpen Then rs. Close
Open test, con
您可能关注的文档
最近下载
- 2026年春季教科版三年级科学下册教学计划及进度表(新版本).docx VIP
- 14.赵海林-北斗云高精度打桩导航定位的副本-20201012-2[1].pptx VIP
- (2026 春新版)二年级科学下册教学计划及进度表.docx VIP
- 重症患者的早期康复课件.pptx VIP
- 2022年新高考全国Ⅱ卷英语真题(原卷版).pdf VIP
- 2026春新版大象版科学三年级下册教学计划.pdf VIP
- 2024年江苏省中考地理试题卷(含答案解析).docx
- 小学数学六年级上册思维拓展精选练习题.docx VIP
- 北斗云 DZ502 打桩放线导航仪 快速操作安装手册说明书.pdf VIP
- 美国机械学会标准ASME B16.51-2013 Copper and Copper Alloy Press-Connect Pressure Fittings.pdf VIP
原创力文档

文档评论(0)