【发布时间】:2012-03-20 19:34:08
【问题描述】:
我正在开发一个 Windows 应用程序,无法创建 RDLC 本地报告。
报告中只有 2 个文本框,一个是员工姓名,另一个是地址。
一切正常,但我不知道如何传递 RDLC 报告变量并在报告文本框或报告中显示其值。
谢谢
【问题讨论】:
标签: windows vb.net winforms report rdlc
我正在开发一个 Windows 应用程序,无法创建 RDLC 本地报告。
报告中只有 2 个文本框,一个是员工姓名,另一个是地址。
一切正常,但我不知道如何传递 RDLC 报告变量并在报告文本框或报告中显示其值。
谢谢
【问题讨论】:
标签: windows vb.net winforms report rdlc
查看这篇文章:
Using the WinForms ReportViewer Control
编辑:
假设您有一个文本框控件“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()*****
【讨论】: