关于crystalreport的问题.在线等待.

blp 2003-10-09 05:03:27
如何建立仅字段定义的数据源(在数据资源管理器中\更多数据源下面)
双击数据资源管理器中\更多数据源的建立新连接时,
会让你去选择一个文件,文件的后缀名为 .ttx
在vs.net中哪里可以建立 .ttx文件
...全文
43 6 打赏 收藏 转发到动态 举报
写回复
用AI写文章
6 条回复
切换为时间正序
请发表友善的回复…
发表回复
dotnba 2003-12-12
  • 打赏
  • 举报
回复
关注
haibodotnet 2003-10-09
  • 打赏
  • 举报
回复
Using Data Definition (TTX) files to pass an ADO recordset to a Crystal Report
http://support.crystaldecisions.com/communityCS/TechnicalPapers/scr8_ttxado.pdf.asp?recDnlReq=Record&dnlPath=scr8_ttxado.pdf
——————————————————————————————————————
How to use ADO.NET datasets with reports designed from TTX files

Synopsis

An application uses Crystal Reports for Visual Studio .NET 2002 as its reporting and development tool.

How can you use Crystal Reports 8.5 (CR8.5) reports, designed on Data definition Files (TTX files), with ADO.NET datasets in Visual Studio .NET 2002?

Solution

The following example demonstrates how to use CR8.5 reports designed on TTX files with ADO.NET datasets. The CR8.5 reports are loaded from disk into the application at runtime (so as not to upgrade them to the newer .rpt format).

The following code is an example of how to display the data from a dataset:

Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load

Dim rpt As New CrystalDecisions.CrystalReports.Engine.ReportDocument()
Dim ds As New System.Data.DataSet()

' Load a TTX report from disk into the reportdocument object.
rpt.Load("c:\custttx.rpt")

' Read the dataset from an xml file or FILL, using an OledbDataAdapter. ds.ReadXml("c:\customer.xml")

' Set the table name in the dataset to agree with the table name in the report.
ds.Tables(0).TableName = rpt.Database.Tables(0).Name

'Set the dataset to be the report's data source.
rpt.SetDataSource(ds)

'Display the report in the viewer.
CrystalReportViewer1.ReportSource = rpt

End Sub

====================
NOTE:

For the application to run successfully, the dataset table name must agree with the report's expected tablename. If your dataset has more than one table, modify the code to set all the dataset table names to agree with the report's table names.

====================
haibodotnet 2003-10-09
  • 打赏
  • 举报
回复
直接单击下面的“创建文件”按钮,就可以建立.ttx文件
——————————————————————————————————————
备注:“仅字段定义”对话框
使用“字段定义文件”字段旁边的查找按钮搜索定义文件 (.ttx)。也可以在“数据库定义工具”对话框中单击“创建文件”按钮创建新的字段定义文件。

“字段定义”是用于创建报表的特殊驱动程序,创建时仅基于一个没有实际数据的架构。此驱动程序主要用于向后兼容性,并仅在报表创建过程中使用。在运行时,必须将记录集或数据集传递给用该驱动程序创建的报表。
esheng 2003-10-09
  • 打赏
  • 举报
回复
好象没有吧
isonme 2003-10-09
  • 打赏
  • 举报
回复
up
justin007 2003-10-09
  • 打赏
  • 举报
回复
gz

110,533

社区成员

发帖
与我相关
我的任务
社区描述
.NET技术 C#
社区管理员
  • C#
  • Web++
  • by_封爱
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告

让您成为最强悍的C#开发者

试试用AI创作助手写篇文章吧