A problem with SetDataSource

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:
.....

create dataset

....


Dim rptDocument As New CrystalDecisions.CrystalReports.Engine.ReportDocument

rptDocument.Load(ReportName)
rptDocument.SetDataSource(ds.Tables(0))
rptDocument.Refresh()
crw.ReportSource = rptDocument



Answer this question

A problem with SetDataSource

  • levitymn

    try changing rptDocument.SetDatasource(ds.Tables(0)) to rptDocument.Database.Tables.SetDatasource(ds.Tables(0))
  • MathiasR

    Try getting rid of the rptDocument.Refresh() line.
  • papiens

    same result. Report just ignores my dataset:

    rptDocument.Database.Tables(0).SetDataSource(ds.Tables(0))

    crw.ReportSource = rptDocument

    grd.DataSource = dt


  • rashers

    I did. It did not help.

    I just created another report based on a simple table - same result.


  • A problem with SetDataSource