private void BuildChartLegendTabs()
        {
            this.Text = "Chart Legend Properties";

            XmlNode cNode = _Nodes[0];
            XmlNode lNode = _Draw.GetCreateNamedChildNode(cNode, "Legend");

            // Now we replace the node array with a new one containing only the legend
            _Nodes = new List <XmlNode>();
            _Nodes.Add(lNode);

            EnsureStyle();              // Make sure we have Style nodes

            // Chart Legend
            ChartLegendCtl clc = new ChartLegendCtl(_Draw, this._Nodes);

            AddTab("Legend", clc);

            // Style Text
            StyleTextCtl stc = new StyleTextCtl(_Draw, this._Nodes);

            AddTab("Text", stc);

            // Border tab
            StyleBorderCtl bc = new StyleBorderCtl(_Draw, null, this._Nodes);

            AddTab("Border", bc);

            // Style tab
            StyleCtl sc = new StyleCtl(_Draw, this._Nodes);

            AddTab("Style", sc);
        }
        private void BuildTitle(PropertyTypeEnum type)
        {
            XmlNode cNode = _Nodes[0];

            _Nodes = new List <XmlNode>();               // replace with a new one
            if (type == PropertyTypeEnum.ChartTitle)
            {
                this.Text = "Chart Title";

                XmlNode lNode = _Draw.GetCreateNamedChildNode(cNode, "Title");
                _Nodes.Add(lNode);                              // Working on the title
            }
            else if (type == PropertyTypeEnum.CategoryAxisTitle)
            {
                this.Text = "Category (X) Axis Title";
                XmlNode caNode = _Draw.GetCreateNamedChildNode(cNode, "CategoryAxis");
                XmlNode aNode  = _Draw.GetCreateNamedChildNode(caNode, "Axis");
                XmlNode tNode  = _Draw.GetCreateNamedChildNode(aNode, "Title");
                _Nodes.Add(tNode);                              // Working on the title
            }
            // 20022008 AJM GJL
            else if (type == PropertyTypeEnum.ValueAxis2Title)
            {
                this.Text = "Value (Y) Axis (Right) Title";
                XmlNode caNode = _Draw.GetCreateNamedChildNode(cNode, "ValueAxis");
                XmlNode aNode  = _Draw.GetCreateNamedChildNode(caNode, "Axis");
                XmlNode tNode  = _Draw.GetCreateNamedChildNode(aNode, "fyi:Title2");
                _Nodes.Add(tNode);              // Working on the title
            }
            else
            {
                this.Text = "Value (Y) Axis Title";
                XmlNode caNode = _Draw.GetCreateNamedChildNode(cNode, "ValueAxis");
                XmlNode aNode  = _Draw.GetCreateNamedChildNode(caNode, "Axis");
                XmlNode tNode  = _Draw.GetCreateNamedChildNode(aNode, "Title");
                _Nodes.Add(tNode);                              // Working on the title
            }

            EnsureStyle();              // Make sure we have Style nodes

            // Style Text
            StyleTextCtl stc = new StyleTextCtl(_Draw, this._Nodes);

            AddTab("Text", stc);

            // Border tab
            StyleBorderCtl bc = new StyleBorderCtl(_Draw, null, this._Nodes);

            AddTab("Border", bc);

            // Style tab
            StyleCtl sc = new StyleCtl(_Draw, this._Nodes);

            AddTab("Style", sc);
        }
        private void BuildChartAxisTabs(PropertyTypeEnum type)
        {
            string propName;

            if (type == PropertyTypeEnum.CategoryAxis)
            {
                this.Text = "Chart Category (X) Axis";
                propName  = "CategoryAxis";
            }
            else
            {
                this.Text = "Chart Value (Y) Axis";
                propName  = "ValueAxis";
            }

            XmlNode cNode  = _Nodes[0];
            XmlNode aNode  = _Draw.GetCreateNamedChildNode(cNode, propName);
            XmlNode axNode = _Draw.GetCreateNamedChildNode(aNode, "Axis");

            // Now we replace the node array with a new one containing only the legend
            _Nodes = new List <XmlNode>();
            _Nodes.Add(axNode);

            EnsureStyle();              // Make sure we have Style nodes

            // Chart Axis
            ChartAxisCtl cac = new ChartAxisCtl(_Draw, this._Nodes);

            AddTab("Axis", cac);

            // Style Text
            StyleTextCtl stc = new StyleTextCtl(_Draw, this._Nodes);

            AddTab("Text", stc);

            // Border tab
            StyleBorderCtl bc = new StyleBorderCtl(_Draw, null, this._Nodes);

            AddTab("Border", bc);

            // Style tab
            StyleCtl sc = new StyleCtl(_Draw, this._Nodes);

            AddTab("Style", sc);
        }
        private void BuildReportItemTabs()
        {
            XmlNode aNode = _Nodes[0];

            // Determine if all nodes are the same type
            string type = aNode.Name;

            if (type == "CustomReportItem")
            {
                // For customReportItems we use the type that is a parameter
                string t = _Draw.GetElementValue(aNode, "Type", "");
                if (t.Length > 0)
                {
                    type = t;
                }
            }

            foreach (XmlNode pNode in this._Nodes)
            {
                // For customReportItems we use the type that is a parameter
                string t = pNode.Name;
                if (t == "CustomReportItem")
                {
                    t = _Draw.GetElementValue(aNode, "Type", "");
                    if (t.Length == 0)       // Shouldn't happen
                    {
                        t = pNode.Name;
                    }
                }
                if (t != type)
                {
                    type = "";                                          // Not all nodes have the same type
                }
            }

            EnsureStyle();              // Make sure we have Style nodes for all the report items

            if (_Nodes.Count > 1)
            {
                this.Text = "Group Selection Properties";
            }
            else
            {
                string name = _Draw.GetElementAttribute(aNode, "Name", "");
                this.Text = string.Format("{0} {1} Properties", type.Replace("fyi:", ""), name);
            }

            // Create all the tabs
            if (type == "Textbox")
            {
                StyleTextCtl stc = new StyleTextCtl(_Draw, this._Nodes);
                AddTab("Text", stc);
            }
            else if (type == "List")
            {
                ListCtl lc = new ListCtl(_Draw, this._Nodes);
                AddTab("List", lc);
                if (_Nodes.Count == 1)
                {
                    XmlNode    l  = _Nodes[0];
                    FiltersCtl fc = new FiltersCtl(_Draw, l);
                    AddTab("Filters", fc);
                    SortingCtl srtc = new SortingCtl(_Draw, l);
                    AddTab("Sorting", srtc);
                }
            }
            else if (type == "Chart")
            {
                ChartCtl cc = new ChartCtl(_Draw, this._Nodes);
                AddTab("Chart", cc);

                // 05122007 AJM & GJL Create a new StaticSeriesCtl tab
                StaticSeriesCtl ssc = new StaticSeriesCtl(_Draw, this._Nodes);
                if (ssc.ShowMe)
                {
                    //If the chart has static series, then show the StaticSeriesCtl GJL
                    AddTab("Static Series", ssc);
                }


                if (_Nodes.Count == 1)
                {
                    FiltersCtl fc = new FiltersCtl(_Draw, _Nodes[0]);
                    AddTab("Filters", fc);
                }
            }
            else if (type == "System.Drawing.Image")
            {
                ImageCtl imgc = new ImageCtl(_Draw, this._Nodes);
                AddTab("System.Drawing.Image", imgc);
            }
            else if (type == "Table")
            {
                XmlNode  table = _Nodes[0];
                TableCtl tc    = new TableCtl(_Draw, this._Nodes);
                AddTab("Table", tc);
                FiltersCtl fc = new FiltersCtl(_Draw, table);
                AddTab("Filters", fc);
                XmlNode details = _Draw.GetNamedChildNode(table, "Details");
                if (details != null)
                {                       // if no details then we don't need details sorting
                    GroupingCtl grpc = new GroupingCtl(_Draw, details);
                    AddTab("Grouping", grpc);
                    SortingCtl srtc = new SortingCtl(_Draw, details);
                    AddTab("Sorting", srtc);
                }
                if (_TableColumn != null)
                {
                    TableColumnCtl tcc = new TableColumnCtl(_Draw, _TableColumn);
                    AddTab("Table Column", tcc);
                }
                if (_TableRow != null)
                {
                    TableRowCtl trc = new TableRowCtl(_Draw, _TableRow);
                    AddTab("Table Row", trc);
                }
            }
            else if (type == "fyi:Grid")
            {
                GridCtl gc = new GridCtl(_Draw, this._Nodes);
                AddTab("Grid", gc);
            }
            else if (type == "Matrix")
            {
                XmlNode   matrix = _Nodes[0];
                MatrixCtl mc     = new MatrixCtl(_Draw, this._Nodes);
                AddTab("Matrix", mc);
                FiltersCtl fc = new FiltersCtl(_Draw, matrix);
                AddTab("Filters", fc);
            }
            else if (type == "Subreport" && _Nodes.Count == 1)
            {
                XmlNode      subreport = _Nodes[0];
                SubreportCtl src       = new SubreportCtl(_Draw, subreport);
                AddTab("Subreport", src);
            }
            else if (aNode.Name == "CustomReportItem")
            {
                XmlNode             cri  = _Nodes[0];
                CustomReportItemCtl cric = new CustomReportItemCtl(_Draw, _Nodes);
                AddTab(type, cric);
            }

            // Position tab
            PositionCtl pc = new PositionCtl(_Draw, this._Nodes);

            AddTab("Name/Position", pc);

            // Border tab
            StyleBorderCtl bc = new StyleBorderCtl(_Draw, null, this._Nodes);

            AddTab("Border", bc);

            if (!(type == "Line" || type == "Subreport"))
            {
                // Style tab
                StyleCtl sc = new StyleCtl(_Draw, this._Nodes);
                AddTab("Style", sc);

                // Interactivity tab
                InteractivityCtl ic = new InteractivityCtl(_Draw, this._Nodes);
                AddTab("Interactivity", ic);
            }
        }