- 1、本文档共18页,可阅读全部内容。
- 2、原创力文档(book118)网站文档一经付费(服务费),不意味着购买了该文档的版权,仅供个人/单位学习、研究之用,不得用于商业用途,未经授权,严禁复制、发行、汇编、翻译或者网络传播等,侵权必究。
- 3、本站所有内容均由合作方或网友上传,本站不对文档的完整性、权威性及其观点立场正确性做任何保证或承诺!文档内容仅供研究参考,付费前请自行鉴别。如您付费,意味着您自己接受本站规则且自行承担风险,本站不退款、不进行额外附加服务;查看《如何避免下载的几个坑》。如果您已付费下载过本站文档,您可以点击 这里二次下载。
- 4、如文档侵犯商业秘密、侵犯著作权、侵犯人身权等,请点击“版权申诉”(推荐),也可以打举报电话:400-050-0827(电话支持时间:9:00-18:30)。
查看更多
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
您可能关注的文档
最近下载
- 临床微生物学检验技术试题及答案.docx VIP
- Danfoss丹佛斯iC2-Micro Frequency Converters Appl. Gui Application guide说明书用户手册.pdf
- “一带一路”背景下国际投资争端解决机制研究.docx VIP
- JJG 1118-2015 电子汽车衡(衡器载荷测量仪法)(高清).pdf
- 冀教版五年级英语下册全套测试卷.doc
- NB∕T 32036-2017 光伏发电工程达标投产验收规程.docx
- 2024年新《机场安检员》工作岗位试题库(有答案).pdf
- 小学数学三年级下册第三单元《乘法》作业设计.docx VIP
- 超星网课尔雅《知识论导论:我们能知道什么》尔雅答案2022章节测试答案.docx
- JT 711-2008 营运客车燃料消耗量限值及测量方法.pdf VIP
文档评论(0)