通过VB刷新Crystal Report Viewer [英] Refresh Crystal Report Viewer via VB
本文介绍了通过VB刷新Crystal Report Viewer的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
如何清除CrystalReportViewer的内容。我运行一个正确填充CrystalReportViewer的查询。如果我在不离开表单的情况下再次运行,则仍会显示之前的内容。如何清除然后显示?
我的代码示例如下。
Hi,
How do I clear the contents of CrystalReportViewer. I run a query which populates CrystalReportViewer correctly. If I run again without leaving the form, then the previous contents are still displayed. How do I clear then display?
A sample of my code is as follows.
Dim cryRpt As New ReportDocument
cryRpt.Load(Loads the crystal report form)
cryRpt.SetDataSource(MyDatasource.Tables(1))
现在在屏幕上显示结果
Display the results on screen now
CrystalReportViewer1.ReportSource = cryRpt
CrystalReportViewer1.Zoom(75)
CrystalReportViewer1.Refresh()
推荐答案
发现问题。请参阅我的评论。
我每次运行新报告时都没有清除数据源。
Found the problem. See my comment.
I was not clearing my datasource everytime I ran a new report.
这篇关于通过VB刷新Crystal Report Viewer的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文