没有合适的资源?快使用搜索试试~ 我知道了~
资源推荐
资源详情
资源评论
6/24/2002 2:58 PM Copyright
2001 Crystal Decisions, Inc. All Rights Reserved. Page 1
Crystal Reports
Connecting the Report Designer Component to a Data Source
Overview
The Crystal Reports Report Designer Component (RDC) has a number of
properties and methods available at runtime to connect a report to its data
source. This document provides an in depth look at each of these properties,
methods and their arguments. Developers can expect a better understanding of
how to connect Crystal Reports to their data sources at runtime.
Contents
INTRODUCTION ............................................................................................2
ACTIVE DATA SOURCES ..............................................................................2
SetDataSource and SetTablePrivateData ................................................... 2
Data Environments...................................................................................... 4
AddADOCommand and AddOLEDBSource................................................ 5
PERSISTENT DATA SOURCES .......................................................................7
SetLogonInfo ............................................................................................... 7
Location Property ....................................................................................... 9
SetSessionInfo Method .............................................................................. 10
LogonServer and LogonServerEx.............................................................. 10
CONTACTING CRYSTAL DECISIONS FOR TECHNICAL SUPPORT ....................12
Crystal Reports Connecting the RDC to my data source
6/24/2002 2:58 PM Copyright
2001 Crystal Decisions, Inc. All Rights Reserved. Page 2
cr_rdc_dbconnectivity.pdf
Introduction
Using the RDC, Crystal Reports is able to report off of both active data sources
and persistent data sources. Active data sources are recordsets, resultsets, data
arrays and Data Environments that only exist in memory while the application is
running. Persistent data sources are databases, tables, log files, directory
structures, etc. that reside and exist outside of the application. Persistent data can
be broken down further into PC-type data sources and server-type data sources.
The methods/properties of the RDC used to connect reports to these varying data
sources include:
Active Data:
SetDataSource, SetTablePrivateData
AddADOCommand
AddOLEDBSource
Persistent Data:
SetLogonInfo
Location, SetTableLocation
SetSessionInfo
LogonServer, LogonServerEx
Active Data Sources
All reports designed to use Active Data will use the Crystal Reports Active Data
driver, p2smon.dll. The Active Data driver is not designed to report off of a
persistent data source.
SetDataSource and SetTablePrivateData
The SetDataSource method and SetTablePrivateData method are designed to do
exactly the same thing: Pass a populated connected or disconnected recordset to
a report. The SetTablePrivateData is a hidden member of the DatabaseTable
object and is maintained for backwards compatibility. The SetDataSource of the
Database object should be used instead.
Crystal Reports Connecting the RDC to my data source
6/24/2002 2:58 PM Copyright
2001 Crystal Decisions, Inc. All Rights Reserved. Page 3
cr_rdc_dbconnectivity.pdf
Syntax for SetTablePrivateData Method
The syntax of the SetTablePrivateData method is:
Sub SetTablePrivateData(DataTag as long, data)
The first argument, DataTag, is always passed in as the value 3 (this refers to
Active Data). The second argument, data, is one of the following:
• An ActiveX Data Object (ADO) recordset
• A Crystal Data Object (CDO) rowset
• A Remote Data Object (RDO) resultset
Sample code using the SetTablePrivateData Method
Dim Report As New CrystalReport1
Dim ADOrs As New ADODB.Recordset
ADOrs.Open “Select * from Customer”, _
“DSN=Xtreme Sample Database”
‘Pass the ADO Recordset to the first Table in Report
Report.Database.Tables(1).SetTablePrivateData _
3, ADOrs
Syntax for the SetDataSource Method
The syntax for the SetDataSource method is:
Database Object
Sub SetDataSource(data, [dataTag], [tableNumber])
DatabaseTable Object
Sub SetDataSource(data, [dataTag])
The first argument, data, is the recordset/resultset (as mentioned above). The
second optional argument, dataTag, is optional and should always be 3 when
used. Using any other value for dataTag will cause unexpected results. The
third optional argument, tableNumber, specifies which table in the report to
pass the recordset to (the numbering is 1-based with the first table in the report
having the value 1, the second table having the value 2, and so on).
When calling SetDataSource at the DatabaseTable object level, the
tableNumber argument is redundant and should be omitted.
Arguments in square brackets are
optional.
剩余11页未读,继续阅读
资源评论
- zhaoyun8972013-05-22英文的 没注意。。
- casolxia2013-10-28这个还是不错的,只是英文。。。
lonsondong
- 粉丝: 1
- 资源: 6
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
最新资源
- 基于JSP水产品销售系统源码.zip
- 基于JSP手机商城管理系统源码.zip
- 5.3.1_1二叉树的先中后序遍历.mp420240404-134540.png
- 基于JSP实现一个C语言教学网站平台源码.zip
- 抖音快手-课程网盘链接提取码下载 .txt
- 934742083249391XGOBOTV1.2.4.apk
- 课程设计基于OpenCV的材料缺陷检测程序python源码(含超详细注释).zip
- 基于python和百度EsayDL实现自动驾驶算法+基于ESP32开发板作为智能车主控芯片的自动驾驶智能车项目+源码(高分项目)
- Centos7-离线安装-MySQL5-7-31-tar包安装
- 蓝海平台带货-课程网盘链接提取码下载 .txt
资源上传下载、课程学习等过程中有任何疑问或建议,欢迎提出宝贵意见哦~我们会及时处理!
点击此处反馈
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功