Error while calling Crystal Reports -- "Invalid Report Source"

  • Thread starter Thread starter Bibin
  • Start date Start date
B

Bibin

Dear All

I'm having a problem while calling a report in the CrystalReportViewer. The
error message comming is "Invalid Report Source". The code I written is here
below.

conReport = New OleDb.OleDbConnection(sConnectionString)
conReport.Open()
daReport = New OleDb.OleDbDataAdapter("select * from R_City",conReport)
daReport.Fill(dsReport)

crDoc.Load(Application.StartupPath & "\\Reports\\City.rpt")
crDoc.SetDataSource(dsReport)
rptViewer.ReportSource = crDoc
rptViewer.refreshReport()

Anybody if know this...pls help....

Thanks and regards
Bibin.
 
Not sure about crystal reports but if you copied and pasted code shouldn't
your path only contain "\" instead of "\\"
just something i saw.

Jeff
 
Dear Jeff

Thanks for ur reply. But The report is getting loaded into the
ReportDocument Object.
When i given an incalid path it is giving me the "Invalid fila path error".
The error is comming when the CrystalReportViewer tries to display the
report. If you
are aware of this problem, please help

Thanks and Rgds
Bibin
 
Back
Top