?
Solved

Expand and Collapse Groups in ReportViewer in Asp.Net WebForm

Posted on 2014-12-30
1
Medium Priority
?
552 Views
Last Modified: 2015-01-02
I have created a report with Report Builder 3.0 running on SQL Server 2014 in native mode.  The report has grouping by a single field.  When the report is launched from the SSRS site, the grouping with +/- symbols work perfectly.  When called from a ReportViewer control embedded in an Asp.Net page, this functionality appears not to be available.  When a plus image is clicked, the page seems to re-post and display in the same state as before the click.  I am checking for PostBack in the pageload code.

Thanks.

C# code
------------------------------
protected void Page_Load(object sender, EventArgs e)
        {
            if (!Page.IsPostBack)
            {

                //Specify the report server
                ReportViewer1.
                  ServerReport.
                  ReportServerUrl =
                  new Uri(WebConfigurationManager.
                  AppSettings["ReportServerURL"]);

                //Specify the report name
                ReportViewer1.
                  ServerReport.
                  ReportPath = Session["reportPath"].ToString();

                //Specify the server credentials
                /* ReportViewer1.
                  ServerReport.
                  ReportServerCredentials =
                  new CustomReportCredentials
                   (
                     WebConfigurationManager.
                      AppSettings["ReportServerUser"],
                     WebConfigurationManager.
                      AppSettings["ReportServerPassword"],
                     WebConfigurationManager.
                      AppSettings["ReportServerDomain"]
                   );
                 */
                /*
                 * With the report specified, hydrate the report
                 * parameters based on the values in the
                 * reportParameters hash.
                 */
                if(Session["reportParameters"] != null)
                {
                    var reportParameters = (Dictionary<string, string>)Session["reportParameters"];

                    foreach (var item in reportParameters)
                    {
                        ReportViewer1.
                        ServerReport.
                        SetParameters(
                        new List<ReportParameter>()
                            {
                                new ReportParameter(item.Key, item.Value)
                            });
                    }
                }
               

            }

        }
0
Comment
Question by:MinirvaTwo
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
1 Comment
 
LVL 29

Accepted Solution

by:
sammySeltzer earned 1500 total points
ID: 40525325
When I ran into similar problem a year ago, this is the solution that worked for me.

It is still correct today.

http://www.sqlchick.com/entries/2010/9/19/expand-or-collapse-all-grouped-items-on-ssrs-report.html
0

Featured Post

Get MySQL database support online, now!

At Percona’s web store you can order your MySQL database support needs in minutes. No hassles, no fuss, just pick and click. Pay online with a credit card.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

In the first part of this tutorial we will cover the prerequisites for installing SQL Server vNext on Linux.
What if you have to shut down the entire Citrix infrastructure for hardware maintenance, software upgrades or "the unknown"? I developed this plan for "the unknown" and hope that it helps you as well. This article explains how to properly shut down …
Via a live example, show how to shrink a transaction log file down to a reasonable size.
Via a live example, show how to setup several different housekeeping processes for a SQL Server.
Suggested Courses

777 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question