Solved

Expand and Collapse Groups in ReportViewer in Asp.Net WebForm

Posted on 2014-12-30
1
509 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 500 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 15 Days FREE Full-Featured Trial

Benefit from a mission critical IT monitoring with Monitis Premium or get it FREE for your entry level monitoring needs.
-Over 200,000 users
-More than 300,000 websites monitored
-Used in 197 countries
-Recommended by 98% of users

Question has a verified solution.

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

Load balancing is the method of dividing the total amount of work performed by one computer between two or more computers. Its aim is to get more work done in the same amount of time, ensuring that all the users get served faster.
In part one, we reviewed the prerequisites required for installing SQL Server vNext. In this part we will explore how to install Microsoft's SQL Server on Ubuntu 16.04.
Using examples as well as descriptions, and references to Books Online, show the documentation available for datatypes, explain the available data types and show how data can be passed into and out of variables.
Wufoo.com provides powerful tools for surveying targeted groups, and utilizing data from completed surveys to find trends, discover areas of demand or customer expectation, and make business decisions on products or services.

724 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