Solved

Expand and Collapse Groups in ReportViewer in Asp.Net WebForm

Posted on 2014-12-30
1
426 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
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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Slowly Changing Dimension Transformation component in data task flow is very useful for us to manage and control how data changes in SSIS.
International Data Corporation (IDC) prognosticates that before the current the year gets over disbursing on IT framework products to be sent in cloud environs will be $37.1B.
Using examples as well as descriptions, and references to Books Online, show the different Recovery Models available in SQL Server and explain, as well as show how full, differential and transaction log backups are performed
Via a live example, show how to setup several different housekeeping processes for a SQL Server.

910 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

21 Experts available now in Live!

Get 1:1 Help Now