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.