
Crystal Viewer Does not accept ReportDocument as source
I fixed this!
The problem is that the version of the viewer that ships with MS Visual
studio .NET is based on 9.1. This works fine as long as you don't decide
that Crystal is worth having and buy the upgrade to Crystal 9. This upgrades
the DLLs to version 9.2 which are incompatible with 9.1. As a result, you
end up with you .net project referencing version 9.1 of the viewer and
trying to pass it the version 9.2 ReportDocument object. This version of the
object is not compatible and generates the error.
The fix is to open your project in VS.net. Go to the Project references.
Locate the viewer and see what version it shows in the Property dialog. If
it is 9.1, delete this reference. The re-add the reference to the project.
This time it will be version 9.2 and everything works.
j
Quote:
> Hi,
> I have a VB.Net form that has the Crystal Viewer control on it. This
> control will accept an .rpt file as the ReportSource, but generates and
> invalid Report Source error when I pass a ReportDocument. In code:
> RptViewer.reportsource ="C:\myreport.rpt"
> works fine. But,
> dim mDoc as new CrystalDecsitions.CrystalReports.Engine.ReportDocument()
> mDoc.Load("C:\myreport.rpt")
> RptView.ReportSource = mDoc
> generates an error. Does anyone know why?
> Thanks,
> Jerry