| 网站首页 | 业界新闻 | 小组 | 威客 | 人才 | 下载频道 | 博客 | 代码贴 | 在线编程 | 编程论坛
欢迎加入我们,一同切磋技术
用户名:   
 
密 码:  
共有 908 人关注过本帖
标题:求助 VB.NET中向报表传递参数时出错
只看楼主 加入收藏
dongfangmi
Rank: 1
等 级:新手上路
帖 子:1
专家分:0
注 册:2011-7-11
结帖率:0
收藏
已结贴  问题点数:0 回复次数:1 
求助 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]”。
搜索更多相关主题的帖子: 声明 文本框 
2011-07-15 14:11
不说也罢
Rank: 13Rank: 13Rank: 13Rank: 13
等 级:贵宾
威 望:39
帖 子:1481
专家分:4989
注 册:2007-10-7
收藏
得分:20 
        Dim paramList As New Generic.List(Of ReportParameter)
        Dim temp As ReportParameter = New ReportParameter("name", "789")
        paramList.Add(temp)
        ReportViewer1.LocalReport.SetParameters(paramList)
         .........

===================================================
讨厌C#的行尾的小尾巴;和一对大括号{ }
===================================================
2011-07-15 18:05
快速回复:求助 VB.NET中向报表传递参数时出错
数据加载中...
 
   



关于我们 | 广告合作 | 编程中国 | 清除Cookies | TOP | 手机版

编程中国 版权所有,并保留所有权利。
Powered by Discuz, Processed in 0.071246 second(s), 7 queries.
Copyright©2004-2025, BCCN.NET, All Rights Reserved