none
ReportViewer viewstate issue with ASP.NET tree control RRS feed

  • Question

  •  I have been using a winforms client to access reports over webservice for months. I've got a tree on the left and reports on the right.
    Now I'm putting the same reports in ASP.NET and I'm getting a viewstate error on dynamic controls.
    The reports load fine the 1st time, I can navigate the tree nodes successfully, and I even get another report to open using the Jump To URL navigation in the report.
    The viewstate error occurs after the "Jump to URL" navigation, when I click back on a node in the tree (I'm using Infragistics UltraWebTree for the tree control).
    My guess is that the tree control's viewstate is getting overwritten.
    Any ideas? Thanks!


    Here's the codebehind.
    public partial class _Default : System.Web.UI.Page
    {

        protected void Page_Load(object sender, EventArgs e)
        {
            if (!(Page.IsPostBack))
            {
                //binTableCell.Controls.Add(UltraWebTree1);
                List<Microsoft.Reporting.WebForms.ReportParameter> parameters = new List<Microsoft.Reporting.WebForms.ReportParameter>();
                parameters.Add(new Microsoft.Reporting.WebForms.ReportParameter("DisableLinks", "true"));
            }
           
        }
        protected void UltraWebTree1_NodeClicked(object sender, Infragistics.WebUI.UltraWebNavigator.WebTreeNodeEventArgs e)
        {
         
            try
            {
                if (null != e.Node && null != e.Node.Tag && !string.IsNullOrEmpty(e.Node.Tag.ToString()))
                {

                    List<Microsoft.Reporting.WebForms.ReportParameter> parameters = new List<Microsoft.Reporting.WebForms.ReportParameter>();
                    parameters.Add (new Microsoft.Reporting.WebForms.ReportParameter("DisableLinks","true"));
                    ReportViewer1.ServerReport.ReportPath = e.Node.Tag.ToString();
                    ReportViewer1.ServerReport.SetParameters(parameters);
                    ReportViewer1.PromptAreaCollapsed = false;
                }
            }
            catch(Exception er)
            {

            }
           
        }
    }

     

    Friday, April 25, 2008 12:38 AM

Answers