SSRS 报告查看器刷新而不查看报告

发布于 2025-01-02 18:13:27 字数 1048 浏览 0 评论 0原文

我正在使用reportviewer 9在.net web应用程序中显示SSRS报告 我有三个参数(代码如下) 我不想以编程方式传递任何参数 基本上我想要报告查看器显示带有参数的报告,然后选择任何内容 params 并每次按查看报告,即简单地不与网页交互。

发生的情况是它确实显示参数区域并启用了第一个参数下拉列表 但是当我选择某个值并单击第二个下拉列表时,它会全部刷新使用默认值检索的报告,并且所有下拉列表再次设置为默认值!

它不允许我以有序的方式依次选择 3 个参数下拉列表,然后单击“查看报告”


viewer.ServerReport.ReportServerCredentials =
        new MyReportServerCredentials();
viewer.ProcessingMode = Microsoft.Reporting.WebForms.ProcessingMode.Remote; //work on report resides in the server not local
viewer.ShowFindControls = true;
viewer.ShowRefreshButton = true;
viewer.ShowExportControls = true;
viewer.ShowParameterPrompts = true; //hide parameters area and we will pass it through our controls
viewer.SizeToReportContent = true;
//viewer.ServerReport.
viewer.ServerReport.ReportServerUrl = new Uri(System.Configuration.ConfigurationSettings.AppSettings["ReportingServiceUrl"]); //Report Server URL not Report Server Manager URL
viewer.ServerReport.ReportPath = report.Path;
viewer.ServerReport.Refresh(); //display the report

I am displaying SSRS report in .net web app using reportviewer 9
I have three parameters (code below)
I dont want to pass any parameters programmatically
basically I want reportviewer display report with params and then select whatever
params and press View Report each time i.e. simple no interaction with web page.

What happens is it does display parameter area with first parameter dropdown enabled
but when I select some value and click on second dropdown it all refreshes report retrieved with defaults and all dropdowns set to defaults again!

It does not let me in orderly fashion to select 3 parameter dropdowns one after another and then click on View report


viewer.ServerReport.ReportServerCredentials =
        new MyReportServerCredentials();
viewer.ProcessingMode = Microsoft.Reporting.WebForms.ProcessingMode.Remote; //work on report resides in the server not local
viewer.ShowFindControls = true;
viewer.ShowRefreshButton = true;
viewer.ShowExportControls = true;
viewer.ShowParameterPrompts = true; //hide parameters area and we will pass it through our controls
viewer.SizeToReportContent = true;
//viewer.ServerReport.
viewer.ServerReport.ReportServerUrl = new Uri(System.Configuration.ConfigurationSettings.AppSettings["ReportingServiceUrl"]); //Report Server URL not Report Server Manager URL
viewer.ServerReport.ReportPath = report.Path;
viewer.ServerReport.Refresh(); //display the report

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

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

发布评论

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

评论(1

鹤仙姿 2025-01-09 18:13:27

更改值是回发,您应该将代码包装在上面,以便仅在不回发时才会发生。

Changing values is a postback, you should wrap your code above so that it only occurs if not posting back.

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