Click here to Skip to main content
13,552,731 members
Rate this:
Please Sign up or sign in to vote.
See more:
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);


This is what inside btnBack click
pnlRptViewer.Visible = false;

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.
Posted 6-Jan-13 16:11pm

1 solution

Rate this: bad
Please Sign up or sign in to vote.

Solution 1

This solution helped me. Add rptviewer.Reset() before setting credentials.
Thant-Sin-Lin 27-Feb-13 1:59am
Thanks a lot. It's work now :D
User-11179381 13-Feb-15 1:50am
thanks first link and error solved...;)

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

  Print Answers RSS
Top Experts
Last 24hrsThis month

Advertise | Privacy |
Web04 | 2.8.180515.1 | Last Updated 21 Feb 2013
Copyright © CodeProject, 1999-2018
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100