为Crystal Report Viewer 2016控件设置ReportSource

时间:2017-04-19 03:54:34

标签: vb.net crystal-reports report

我正在尝试将vb6系统转换为VB.Net。我已经安装了Crystal Reports 2016 - 最新版本。我放置了控件" Crystal ActiveX Report Viewer Control 14.0"在表格上。

当我尝试设置

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

我收到以下消息:

  

" System.InvalidCastException:指定的强制转换无效。" &安培; vbCrLf& "在CrystalActiveXReportViewerLib14.ICrystalReportViewer12.set_ReportSource(Object pVal)" &安培; vbCrLf& "在AxCrystalActiveXReportViewerLib14.AxCrystalActiveXReportViewer.set_ReportSource(对象值)" &安培; vbCrLf& "在D:\ Visual Studio 2017 \ Projects \ CrystalReportViewer2 \ frmViewer.vb中的CrystalReportViewer2.frmViewer.frmViewer_Load(Object sender,EventArgs e):第9行"   抛出异常:' System.InvalidCastException'在AxInterop.CrystalActiveXReportViewerLib14.dll

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

1 个答案:

答案 0 :(得分:0)

在从Crystal Reports获得运行后,我决定转换为Microsoft Access。

内华达州

相关问题