SetDataSource is ignored, the whole table is shown
Please, help!
I have a report, created based on a SQL command.
I pass it a datasource filtered for a specific name but crystal still shows me data for all names instead of my datasource contents.
Here is my code:
Dim rptDocument As New CrystalDecisions.CrystalReports.Engine.ReportDocum ent
rptDocument.Load(ReportName)
Dim da As SqlClient.SqlDataAdapter = New SqlClient.SqlDataAdapter(SQL, cn)
Dim ds As New DataSet
da.Fill(ds, "Table1")
rptDocument.SetDataSource(ds.Tables(0))
rptDocument.Database.Tables(0).SetDataSource(ds.Ta bles(0))
rptDocument.Refresh()
crw.ReportSource = rptDocument
|