c# - WebForm.ReportViewer 无限循环问题

标签 c# asp.net visual-studio

我在 Visual Studio 2010 (C#) 中使用报表查看器加载 RDL 文件时遇到一个奇怪的问题。

我使用以下代码加载 RDL:

        //get the data set and then 
        //.
        //.
        //pass the report to the viewer            
        using (FileStream stream = new FileStream(_AccessReportDocument.FileName, FileMode.Open))
        {
            this.AccessReportViewer.LocalReport.LoadReportDefinition(stream);
        }
        this.AccessReportViewer.LocalReport.Refresh();

问题在于,一旦上面的代码到达最后一行,代码就会跳转到页面的卸载方法,然后返回到 this.AccessReportViewer.LocalReport.Refresh(); 即无限循环.有谁之前经历过这个吗?我已经读到 vs 2010 的报告查看器存在问题,但主要是设置参数,我还没有尝试做......

调试显示所有数据集等都可以正常检索 - 所以这不是问题所在。

最佳答案

如果您在设置数据源时没有检查回发,VS2010 可能会发生这种情况。这是因为对报表查看器进行了更改以异步加载数据。完整解释在这里:

Reports Never Stop Loading With VS 2010

关于c# - WebForm.ReportViewer 无限循环问题,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/8854017/

相关文章:

c# - 在 Json API 调用中卡住了 DateTime 对象名称

c# - CS3016 - 在使用 Prism + MEF ExportModule 时我们如何解决这个问题?

c# - InstallAllUsers 选项如何工作?

c# - ASP MVC5 身份用户抽象

jquery - Ajax场景下如何返回错误

ASP.NET 挂起 - 通用字典并发问题导致 GC 死锁

visual-studio - 无法在 Visual Studio 中打开表格项目文件

html - Regex Match 内部匹配

c# - 从 IntelliSense 隐藏命名空间或更改建议命名空间的顺序(自定义 IntelliSense)

c# - 在 C# 中将 MIDI 消息发送到 DAW