简体   繁体   中英

Pass TextBox Data to RDLC report

My apologies for such a simple question but after 3 days of searching I cannot find an answer. I have a VS 2012 VB.NET application and Report. I would like to have the user enter information on a windows form, for example "Client Name: [textbox1] ". I want to pass the entered value of textbox1 to a report field. I have created the report field textbox and created a parameter in the report (rdlc) as @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

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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