我有两个带有不同表格的水晶报告(PatientBiodataReport.rpt 和 StaffBiodataReport.rpt),我有一个搜索框(文本框)来过滤这两个报告并将结果返回给 CrystalReportViewer1,还有一个按钮来返回所有记录(查看全部).. . 所以在 PatientBiodataReport.rpt 中成功搜索到患者后,如果我决定更改控制返回 StaffBiodataReport.rpt 中的所有记录,但会提示错误,表明之前从 PatientBiodata 中的选择公式仍在使用中,将更改 CrystalReportViewer1。 ReportSource 到 StaffBiodataReport。 请问如何去掉之前水晶报表的选择公式
>>这些是搜索按钮的代码<<
Private Sub searchbtn_Click(sender As Object, e As EventArgs) Handles searchbtn.Click
If Biodatasearchtxt.Text <> "" Then
If GroupBox1.Text = "Patient Biodata Reports Controls" Then
CrystalReportViewer1.ReportSource = Application.StartupPath + "\Reports\PatientBiodataReport.rpt"
CrystalReportViewer1.SelectionFormula = "{patient_biodata.healthcare_no}='" & Biodatasearchtxt.Text.ToString() & "'"
Else
CrystalReportViewer1.ReportSource = Application.StartupPath + "\Reports\StaffBiodataReport.rpt"
CrystalReportViewer1.SelectionFormula = "{staff_biodata.employee_id}='" & Biodatasearchtxt.Text.ToString() & "'"
End If
Else
MsgBox("Please Enter the Search criteria", MsgBoxStyle.Critical)
End If
End Sub
>>这些是查看全部按钮的代码<<
Private Sub Button1_Click(sender As Object, e As EventArgs) Handles Button1.Click
With CrystalReportViewer1
If GroupBox1.Text = "Patient Biodata Reports Controls" Then
CrystalReportViewer1.ReportSource = Application.StartupPath + "\Reports\PatientBiodataReport.rpt"
Else
CrystalReportViewer1.ReportSource = Application.StartupPath + "\Reports\StaffBiodataReport.rpt"
End If
End With
End Sub