I am attempting to convert a vb6 system to VB.Net. I have installed Crystal Reports 2016 - the latest version. I have placed the control "Crystal ActiveX Report Viewer Control 14.0" on a form.
When I attempt to set
crViewer.ReportSource = CObj("...\adjrec.rpt")
I get the following message:
"System.InvalidCastException: Specified cast is not valid." & vbCrLf & " at CrystalActiveXReportViewerLib14.ICrystalReportViewer12.set_ReportSource(Object pVal)" & vbCrLf & " at AxCrystalActiveXReportViewerLib14.AxCrystalActiveXReportViewer.set_ReportSource(Object value)" & vbCrLf & " at CrystalReportViewer2.frmViewer.frmViewer_Load(Object sender, EventArgs e) in D:\Visual Studio 2017\Projects\CrystalReportViewer2\frmViewer.vb:line 9" Exception thrown: 'System.InvalidCastException' in AxInterop.CrystalActiveXReportViewerLib14.dll
How do I set the ReportSource? A worked example will be helpful.