问题描述
您好!,
从ASP.Net网络表单查看嵌套的SSRS报告时遇到问题。
我有两个项目,一个用于SSRS,另一个用于SSRS对于ASP.Net。
在SSRS项目中,我有两个报告文件(Summary.rdl,Details.rdl)
Summary.rdl以单行显示报告数据,例如。代码,名称,描述,备注。
摘要栏中提交的代码有一个动作转到报告 - Details.rdl以详细显示所选记录行。
在ASP.Net项目中,我有一个网页表格,其中包含 -
1.一些报告标准控件,
2. Microsoft .Reporting.WebForms.ReportViewer控件在面板内(让我们说panel1)
3.按钮,名称为btnPreview来查看报告。 (显示面板)
4.名称为btnBack的按钮隐藏报告并选择标准。 (隐藏面板)
当我点击预览时,它将显示具有所需标准的Summary.rdl。它工作正常。我更改了一些报告条件并再次单击预览,它仍然按预期工作。
仅当出现错误时,
1.单击预览按钮。
2.单击代码并查看详细信息报告(详细报告正确显示)
3.关闭报告。 (只需隐藏面板)
4.再次单击预览按钮。然后,我得到一个例外由于对象的当前状态,操作无效。
备注:如果我不点击链接摘要报告,一切顺利。
这是btnPreview点击内容。
Hello!,
I am having a problem when viewing nested SSRS report from ASP.Net web form.
I have two projects, one for SSRS and another one for ASP.Net.
In SSRS project, I have two report files (Summary.rdl, Details.rdl)
Summary.rdl show report data in single line, for eg. Code, Name, Description, Remark.
"Code" filed from summary column have an action "Go to report" - Details.rdl to show selected line of record in details.
In ASP.Net project, I have a web form that contains -
1. some report criteria controls,
2. Microsoft.Reporting.WebForms.ReportViewer control inside a panel (let''s say panel1)
3. button with the name "btnPreview" to see report. (show Panel)
4. button with the name "btnBack" to hide report and choose criteria. (hide Panel)
When I click preview, it will show "Summary.rdl" with desired criteria. It''s work fine. I change some report criteria and click preview again, it''s still working as expected.
Error occur only when,
1. Click preview button.
2. Click on the column "Code" and see details report (Details report shows correctly)
3. Close the report. (just hide the panel)
4. Click preview button again. Then, I got an exception "Operation is not valid due to the current state of the object".
Remark: If I don''t click on the link from summary report, everything goes fine.
This is what inside btnPreview click.
pnlRptViewer.Visible = true;
rptviewer.ServerReport.ReportServerCredentials = new ReportServerNetworkCredential();
rptviewer.ServerReport.ReportServerUrl = new Uri(ConfigurationManager.AppSettings["RSURL"].ToString());
rptviewer.ServerReport.ReportPath = mReportConfiguration.mReportInfo.mReportPath;
rptviewer.ServerReport.GetDataSources(out allCredentialsSet);
rptviewer.ServerReport.SetParameters(aReportParamsCollection);
rptviewer.ServerReport.Refresh();
这就是btnBack里面的点击
This is what inside btnBack click
pnlRptViewer.Visible = false;
初始化ReportServerCredentials时出错。
当我点击摘要报告上的链接时,我认为报表服务器上的内容已更改。但我不知道出了什么问题。
请帮忙。如果还有其他信息我需要提供,请告诉我。
提前致谢。
Error occur when initializing ReportServerCredentials.
I think something was changed on report server when I click a link on summary report. But I don''t know what''s going wrong.
Please help. And let me know if there is any other information that I need to provide.
Thanks in advance.
推荐答案
这篇关于出现异常“由于对象的当前状态,操作无效”从ASP.Net使用SSRS时的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!