直接单击下面的“创建文件”按钮,就可以建立.ttx文件
——————————————————————————————————————
备注:“仅字段定义”对话框
使用“字段定义文件”字段旁边的查找按钮搜索定义文件 (.ttx)。也可以在“数据库定义工具”对话框中单击“创建文件”按钮创建新的字段定义文件。“字段定义”是用于创建报表的特殊驱动程序,创建时仅基于一个没有实际数据的架构。此驱动程序主要用于向后兼容性,并仅在报表创建过程中使用。在运行时,必须将记录集或数据集传递给用该驱动程序创建的报表。

解决方案 »

  1.   

    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 filesSynopsisAn 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? SolutionThe 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. ====================