1

这是我的 VB.NET (2012) 代码,用于显示基于Combobox (cmbCustomer)选择的报告,我想cmbCustomer.text在报告上打印该参数。

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
4

1 回答 1

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()
于 2013-02-07T08:13:13.780 回答