求助 VB.NET中向报表传递参数时出错
FORM窗体中已经声明Imports System.Data.OleDb
Imports Microsoft.Reporting.WinForms
窗体中添加ReportViewer控件,然后在窗体LOAD事件中写入代码
Dim temp As New ReportParameter("name", "789")
ReportViewer1.LocalReport.SetParameters(temp)
ReportViewer1.LocalReport.Refresh()
报表中也建了参数name,和报表中的文本框显示了,可是提示出错
将“Microsoft.Reporting.WinForms.ReportParameter”转换为“System.Collections.Generic.IEnumerable(Of Microsoft.Reporting.WinForms.ReportParameter)”时可能发生运行时错误。
运行时提示:
无法将类型为“Microsoft.Reporting.WinForms.ReportParameter”的对象强制转换为类型“System.Collections.Generic.IEnumerable`1[Microsoft.Reporting.WinForms.ReportParameter]”。