我正在使用Windows应用程序,无法创建RDLC本地报告。VB.NET中的窗体RDLC报告参数
报告中只有2个文本框,一个是员工名称&另一个是地址。
一切都很好,但我无法弄清楚如何通过RDLC报告变量&在报告文本框或报告中显示其值。
感谢
我正在使用Windows应用程序,无法创建RDLC本地报告。VB.NET中的窗体RDLC报告参数
报告中只有2个文本框,一个是员工名称&另一个是地址。
一切都很好,但我无法弄清楚如何通过RDLC报告变量&在报告文本框或报告中显示其值。
感谢
检查这个帖子:
Using the WinForms ReportViewer Control
编辑:
假设你有一个TextBox控件 “TxtParameter”,您输入员工的社会安全号码。
'Create a report parameter for the sales order number
Dim rpEmployeeSSN As New ReportParameter()
rpEmployeeSSN.Name = "SocialSecurityNumber"
rpEmployeeSSN.Values.Add(TxtParameter.Text)
'Set the report parameters for the report
Dim parameters() As ReportParameter = {rpEmployeeSSN}
localReport.SetParameters(parameters)
'Refresh the report
reportViewer1.RefreshReport()
*****Me.movingselectedTableAdapter.Fill(Me.LRCDBDataSet.movingselected)
'+++++++++++++ passing parameter
Dim repdate As Date = System.DateTime.Now.ToShortDateString()
Dim params(0), myparam As ReportParameter
'++++++++++++++++++try2
Dim myparams As New List(Of ReportParameter)
myparam = New ReportParameter("rptcrdate", repdate)
myparams.Add(myparam)
'Report_Parameter_1
ReportViewer1.LocalReport.SetParameters(myparams)
Me.ReportViewer1.RefreshReport()*****
考虑在答案中添加更多信息。上面的代码是做什么的? – ch4nd4n 2012-12-06 10:51:06
嘿@Nathan感谢答复, 我所拥有的一切设置与我也能看到空白的ReportViewer当我运行应用程序,但便无法将参数传递到RDLC。 谢谢 – Pankaj 2012-03-21 05:02:01
检查我编辑的回复。 – Nathan 2012-04-02 18:01:38