Solved

Expand and Collapse Groups in ReportViewer in Asp.Net WebForm

Posted on 2014-12-30
1
412 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
1 Comment
 
LVL 28

Accepted Solution

by:
sammySeltzer earned 500 total points
Comment Utility
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

Maximize Your Threat Intelligence Reporting

Reporting is one of the most important and least talked about aspects of a world-class threat intelligence program. Here’s how to do it right.

Join & Write a Comment

Suggested Solutions

Thoughout my experience working on eCommerce web applications I have seen applications succumbing to increased user demand and throughput. With increased loads the response times started to spike, which leads to user frustration and lost sales. I ha…
Ever wondered why sometimes your SQL Server is slow or unresponsive with connections spiking up but by the time you go in, all is well? The following article will show you how to install and configure a SQL job that will send you email alerts includ…
Via a live example, show how to set up a backup for SQL Server using a Maintenance Plan and how to schedule the job into SQL Server Agent.
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.

763 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

Need Help in Real-Time?

Connect with top rated Experts

6 Experts available now in Live!

Get 1:1 Help Now