1

我在 vs.net 2008 中使用 stimulsoft report 2013 创建了一个简单的报告。我正在使用这些代码来显示报告:

    StiReport1.RegData(ds)
    StiReport1.Render()
    StiReport1.Show()

当我单击按钮时,我可以第一次正确地看到报告。但是当我关闭reportviewer的Windows并再次单击该按钮时,报告为空(我可以看到页眉或页脚,但报告中没有加载数据)我认为报告数据不会再次加载或缓存中保存的内容。请帮忙。谢谢

4

4 回答 4

1

解决了试试这个代码。它为我工作

StiReport1.Dictionary.DataStore.Clear();
StiReport1.Dictionary.Databases.Clear();
StiReport1.Dictionary.DataSources.Clear();
StiReport1.BusinessObjectsStore.Clear();

StiReport1.RegData(ds)
StiReport1.Dictionary.Synchronize();
StiReport1.Compile();
于 2016-05-04T05:47:52.737 回答
1

试试这个方法:

StiReport1.ResetRenderedState();
于 2019-04-22T16:06:00.487 回答
0

问题解决了。我应该只保存报告并每次加载它:

    Dim rpt As Stimulsoft.Report.StiReport = New Stimulsoft.Report.StiReport
    rpt.Load("report/MyReport.mrt")
    rpt.RegData(ds)
    rpt.Render()
    rpt.Show()
于 2014-01-09T08:45:07.910 回答
0

您需要在渲染之前重置您的查看器。在 Reg 和 Render 代码之前使用 ResetReport() 函数。

于 2016-01-31T09:19:38.710 回答