Microsoft 报告查看器不显示报告

发布于 2024-10-09 19:57:08 字数 398 浏览 0 评论 0原文

我正在开发一个小型 Windows 应用程序。该应用程序需要显示一些报告。对于每个报告,我使用报告查看器控件制作了一个简单的表单。当表单显示时,我调用 RefreshReport() 方法并显示报告。我的问题是这样的 - 一份报告根本不显示。我只得到带有空 ReportViewer 控件的表单。也没有“生成报告”消息。我使用的查询返回正确的数据,但运行应用程序时无法获取任何内容。对于每个报告,我都使用单独的数据集。在每个 DtaSet 中,我已将要在相应报告中使用的表放置在其中。我还尝试使用报表服务器项目向导(Visual Studio 中的商业智能项目 > 报表服务器)创建此特定报表。它正确地显示了报告。我使用完全相同的设置,相同的查询,一切都是相同的。可能是什么问题?为什么 Visual Studio 无法向我显示此报告?其他报告工作正常。

谢谢

I am working on a small windows application. The application needs to show some reports. For each report, I made a simple form with Report Viewer control. When the form shows up, I call the RefreshReport() method and the report is shown. My problem is this - one report does not show up at all. I get only form with empty ReportViewer control. There is also no "Generating report" message. The query I use returns the correct data, but I am unable to get anything when I run the application. For each of the reports, I am using separate dataset. In each DtaSet I have placed the tables I want to use in corresponding report. I
I have also tried to create this particular report using Report Server Project Wizard (Business Intelligence Project > Report Server in Visual Studio). It showed the report correctly. I used exactly the same settings, same query, everything is identical. What could be the problem? Why is Visual Studio unable to show me this report? The other reports are working fine.

Thanks

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

浅紫色的梦幻 2024-10-16 19:57:08

好吧,我知道发生了什么事。由于某种原因,在创建报告期间引发了异常。例外是“看不见的”——没有任何关于它的消息,什么也没有。当我逐行调试整个过程时,我发现了它。当执行查询时(查询包含多个 JOIN 命令),异常似乎源自数据库级别。我通过简单地放置 Fill() 方法(当在 try 块中打开表单时填充数据集)和一个空的 catch 块来解决整个问题。报告显示正确。

Ok, I found out what was happening. For some reason, an exception was thrown during the creation of the report. The exception was "invisible" - there was no any message about it, nothing. I caught it when I was debugging the whole thing line by line. It seems that the exception originates on the database level, when the query is executed (the query contains several JOIN commands). I solved the whole thing by simply putting the Fill() method, which fills the dataset when the form is opened in the try block, with an empty catch block. The report showed correctly.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文