【问题标题】:can't show a stimulsoft report more than 1 time不能超过 1 次显示 stimulsoft 报告
【发布时间】:2014-01-26 16:13:30
【问题描述】:

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

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

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

【问题讨论】:

    标签: report stimulsoft


    【解决方案1】:

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

    StiReport1.Dictionary.DataStore.Clear();
    StiReport1.Dictionary.Databases.Clear();
    StiReport1.Dictionary.DataSources.Clear();
    StiReport1.BusinessObjectsStore.Clear();
    
    StiReport1.RegData(ds)
    StiReport1.Dictionary.Synchronize();
    StiReport1.Compile();
    

    【讨论】:

      【解决方案2】:

      试试这个方法:

      StiReport1.ResetRenderedState();
      

      【讨论】:

        【解决方案3】:

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

            Dim rpt As Stimulsoft.Report.StiReport = New Stimulsoft.Report.StiReport
            rpt.Load("report/MyReport.mrt")
            rpt.RegData(ds)
            rpt.Render()
            rpt.Show()
        

        【讨论】:

          【解决方案4】:

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

          【讨论】:

            猜你喜欢
            • 1970-01-01
            • 1970-01-01
            • 2016-09-02
            • 1970-01-01
            • 1970-01-01
            • 1970-01-01
            • 1970-01-01
            • 1970-01-01
            • 1970-01-01
            相关资源
            最近更新 更多