简体   繁体   English

将文本框数据传递给 RDLC 报告

[英]Pass TextBox Data to RDLC report

My apologies for such a simple question but after 3 days of searching I cannot find an answer.对于这么简单的问题,我深表歉意,但经过 3 天的搜索,我找不到答案。 I have a VS 2012 VB.NET application and Report.我有一个 VS 2012 VB.NET 应用程序和报告。 I would like to have the user enter information on a windows form, for example "Client Name: [textbox1] ".我想让用户在 Windows 窗体上输入信息,例如“客户端名称:[textbox1]”。 I want to pass the entered value of textbox1 to a report field.我想将 textbox1 的输入值传递给报告字段。 I have created the report field textbox and created a parameter in the report (rdlc) as @reportparam1.我创建了报告字段文本框,并在报告 (rdlc) 中创建了一个参数作为 @reportparam1。 Once the user completes the form he/she will press a button that brings up the report.用户完成表单后,他/她将按下一个按钮以显示报告。

You have to set parameter value and pass it to your report:您必须设置参数值并将其传递给您的报告:

Dim parReportParam1 As New ReportParameter("parReportParam1", Me.TextBox1.Text)
Me.YourReportViewer.LocalReport.SetParameters(New ReportParameter() {parReportParam1})

In your report you must set textbox value as:在您的报告中,您必须将文本框值设置为:

=Parameters!parReportParam1.Value

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM