这是我的VB.NET(2012)代码,用于显示基于Combobox
(cmbCustomer)选择的报告,我想在报告上打印该参数cmbCustomer.text
。 / p>
Private Sub btnShow_Click(sender As Object, e As EventArgs) Handles btnShow.Click
Me.rpt_customerByDateTableAdapter.Fill(Me.customerByDateDataSet.rpt_customerByDate,
cmbCustomer.Text)
Me.ReportViewer1.RefreshReport()
End Sub
答案 0 :(得分:0)
以下是假设您已在rldc
Dim customer As String = cmbCustomer.text
Dim CustomerParam As New ReportParameter("yourCustomerParameter", customer)
Dim reportParameters() As ReportParameter = {CustomerParam}
Me.DataTable1TableAdapter.Fill(Me.customerByDateDataSet.rpt_customerByDate,
cmbCustomer.Text)
Me.ReportViewer1.LocalReport.SetParameters(reportParameters)
Me.ReportViewer1.RefreshReport()