我在过滤 rdlc 中的特殊字符时遇到了这个问题,但是当我在 datagridview 中使用此代码时,它运行没有错误。
Me.StockcardMaterialTableAdapter.Fill( Me.aldrichDataSet28.StockcardMaterial)
Dim Tarantado As New ReportParameter("GAGO", YY.Value)
Try
If Not String.IsNullOrEmpty(TextBox1.Text) Then
Dim keyword As String = TextBox1.Text.Trim()
StockcardMaterialBindingSource.Filter =
"(ProductName LIKE '%" & keyword & "%')"
ReportViewer1.LocalReport.SetParameters(New ReportParameter() {Tarantado})
ReportViewer1.RefreshReport()
ElseIf TextBox1.text = Nothing Then
StockcardMaterialBindingSource.RemoveFilter()
ReportViewer1.RefreshReport()
End If
Catch ex As Exception
MessageBox.Show("Error: " + ex.Message.ToString(),
"Error Handler - Code A Minute.",
MessageBoxButtons.OK, MessageBoxIcon.Information)
Finally
TextBox1.Focus()
End Try
txtmonth.Text = ""
txtTin.Text = ""
txtQuarter.Text = ""