2017-04-19 120 views
0

我试图将vb6系统转换为VB.Net。我已经安装了Crystal Reports 2016 - 最新版本。我已将控件“Crystal ActiveX报表查看器控件14.0”放在窗体上。设置Crystal Report Viewer 2016控件的ReportSource

当我试图设置

crViewer.ReportSource = CObj("...\adjrec.rpt") 

我得到以下信息:

“System.InvalidCastException:指定的转换无效。” & vbCrLf & “在CrystalActiveXReportViewerLib14.ICrystalReportViewer12.set_ReportSource(对象PVAL)” & vbCrLf & “在AxCrystalActiveXReportViewerLib14.AxCrystalActiveXReportViewer.set_ReportSource(对象的值)” & vbCrLf &“在CrystalReportViewer2.frmViewer.frmViewer_Load(对象发件人,EventArgs e)在d: \的Visual Studio 2017 \项目\ CrystalReportViewer2 \ frmViewer.vb:9" 号线 抛出异常:则 '' 在AxInterop.CrystalActiveXReportViewerLib14.dll

如何设置ReportSource?一个有效的例子将会有所帮助。

回答

0

从Crystal Reports得到解决办法后,我决定转换为Microsoft Access。

Nev