Hi,
The code I am using is the standard tutorial sample code in VB_Win_Data_DataSets.
Public Class Form1
Private customerReport As ReportDocument
Private Sub ConfigureCrystalReports()
customerReport = New ReportDocument()
Dim reportPath As String = Application.StartupPath & "\" &
"Customer.rpt"
' My version of the report displays the CustomerId and name.
customerReport.Load(reportPath)
Dim myDataSet As DataSet = DataSetConfiguration.CustomerDataSet
' I have placed code to iterate thru myDataSet here and it's
' populated with the correct data.
customerReport.SetDataSource(myDataSet)
myCrystalReportViewer.ReportSource = customerReport
End Sub
Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles MyBase.Load
ConfigureCrystalReports()
End Sub
End Class
The only code changes I have made are to the DataSetConfiguration class.
I use the Enterprise Library, both here and in the app I'm developing to populate the dataset and it works fine.
Imports System.Data
Imports System.Data.OleDb
Imports Microsoft.Practices.EnterpriseLibrary.Data
Imports Microsoft.Practices.EnterpriseLibrary.Common
Public Class DataSetConfiguration
Public Shared ReadOnly Property CustomerDataSet() As DataSet
Get
Dim dsCustomer As DataSet = Nothing
Try
Dim db As Microsoft.Practices.EnterpriseLibrary.Data.Database=
Microsoft.Practices.EnterpriseLibrary.Data.DatabaseFactory.CreateDatabase
Dim sqlCommand As String = "sel_EBCustomer"
Dim dbCommand As System.Data.Common.DbCommand = db.GetStoredProcCommand(sqlCommand)
dsCustomer = db.ExecuteDataSet(dbCommand)
Catch ex As Exception
MsgBox(ex.Message)
End Try
Return dsCustomer
End Get
End Property
End Class
Best regards
Mike