Vb.net 如何清除或处理Crystal Report中的当前页面?
目前,我可以通过按钮1在CrystalReportViewer1中生成报告。 如何删除报告的当前内容。我需要在上面再印一张唱片 我正在使用VB.netVb.net 如何清除或处理Crystal Report中的当前页面?,vb.net,crystal-reports,Vb.net,Crystal Reports,目前,我可以通过按钮1在CrystalReportViewer1中生成报告。 如何删除报告的当前内容。我需要在上面再印一张唱片 我正在使用VB.net Dim rep As WorkFileTags1 = New WorkFileTags1() CrystalReportViewer1.ReportSource = Nothing rep.Refresh() Connect() reader = New SqlCommand("select c_sfr,c
Dim rep As WorkFileTags1 = New WorkFileTags1()
CrystalReportViewer1.ReportSource = Nothing
rep.Refresh()
Connect()
reader = New SqlCommand("select c_sfr,c_pn,c_sn,c_po,c_dateReceived,c_received from tbl_workfile where c_sfr = '" & ComboBox1.Text & "' ", conn).ExecuteReader
DT.Load(reader)
rep.SetDataSource(DT)
CrystalReportViewer1.ReportSource = rep
您可以将
ReportSource
设置为Nothing
,然后使用Refresh()
重新加载ReportViewer
Dim rep As WorkFileTags1 = New WorkFileTags1()
CrystalReportViewer1.ReportSource = Nothing
rep.Refresh()
Connect()
reader = New SqlCommand("select c_sfr,c_pn,c_sn,c_po,c_dateReceived,c_received from tbl_workfile where c_sfr = '" & ComboBox1.Text & "' ", conn).ExecuteReader
DT.Load(reader)
rep.SetDataSource(DT)
CrystalReportViewer1.ReportSource = rep
您可以添加一个按钮来清除它,并将以下内容添加到按钮的事件中
CrystalReportViewer1.ReportSource=无
CrystalReportViewer1.Refresh()
@feltersnach发布了一篇关于尝试它的文章。它刷新了视图,但在上一个报告的底部仍然打印着“没有发生任何事情”。啊,是的,似乎缺少一些代码,所以我没有看到。很高兴它成功了!如果我的回答对你有帮助,请务必接受:)