Click here to Skip to main content
11,647,828 members (63,616 online)
Rate this: bad
good
Please Sign up or sign in to vote.
See more: ASP.NET SSRS
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();

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
tslin89784

1 solution

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

Solution 1

This solution helped me. Add rptviewer.Reset() before setting credentials.
  Permalink  
Comments
TSLin306 at 27-Feb-13 1:59am
   
Thanks a lot. It's work now :D
Member 11213630 at 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
0 jyo.net 500
1 F-ES Sitecore 410
2 DamithSL 290
3 CPallini 290
4 OriginalGriff 277
0 OriginalGriff 1,342
1 jyo.net 994
2 DamithSL 971
3 Sergey Alexandrovich Kryukov 873
4 CPallini 795


Advertise | Privacy | Mobile
Web02 | 2.8.150804.4 | Last Updated 21 Feb 2013
Copyright © CodeProject, 1999-2015
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