Exemple #1
0
        private void LoadGraphOptions()
        {
            // selType
            string[] names = System.Enum.GetNames(_report.GraphType.GetType());
            Array.Sort(names);
            for (int i = 0; i < names.Length; i++)
            {
                selType.Items.Add(names[i]);
                if (_report.GraphType.ToString() == names[i])
                {
                    selType.Items[i].Selected = true;
                }
            }

            // selColorTheme
            string theme = (_report.GraphTheme == null || _report.GraphTheme == "" ? _chCtrl.AppearanceName : _report.GraphTheme);

            string[] themes = _chCtrl.GetAppearanceNames();
            for (int i = 0; i < themes.Length; i++)
            {
                selColorTheme.Items.Add(themes[i]);
                if (theme == themes[i])
                {
                    selColorTheme.Items[i].Selected = true;
                }
            }

            // selNumOptions
            selNumOptions.Items.Add(new ListItem("Values", "0"));
            selNumOptions.Items.Add(new ListItem("Scaling by Series", "1"));
            selNumOptions.Items.Add(new ListItem("Percent by Categories", "2"));
            if ((_report.GraphOptions & OlapReport.GraphOptionsEnum.ScalingBySeries) > 0)
            {
                if (_report.GraphType == OlapReport.GraphTypeEnum.Pie)
                {
                    selNumOptions.SelectedIndex = 0;
                }

                else
                {
                    selNumOptions.SelectedIndex = 1;
                }
            }
            else if ((_report.GraphOptions & OlapReport.GraphOptionsEnum.PercentByCategories) > 0)
            {
                selNumOptions.SelectedIndex = 2;
            }
            else
            {
                selNumOptions.SelectedIndex = 0;
            }

            // txtWidth and txtHeight
            Size size = AdjustGraphWidth(new Size(_report.GraphWidth, _report.GraphHeight), _report.GraphType);

            txtWidth.Text  = size.Width.ToString();
            txtHeight.Text = size.Height.ToString();

            // areaPieColumns and txtPieColumns
            this.areaPieColumns.Visible = (_report.GraphType == OlapReport.GraphTypeEnum.Pie || _report.GraphType == OlapReport.GraphTypeEnum.PieBrokenApart);
            txtPieColumns.Text          = _report.GraphPieColumns.ToString();

            // areaMixedLinePos and txtMixedLinePos
            this.areaMixedLinePos.Visible = (_report.GraphType == OlapReport.GraphTypeEnum.LineWithBars);
            // this.selMixedLinePos will be handled in LoadGraph()
            //this.txtMixedLinePos.Text = _report.GraphMixedLinePosition.ToString();

            //chkRotateAxes
            OlapReport.GraphOptionsEnum graphOption = OlapReport.GraphOptionsEnum.Pivot;
            chkRotateAxes.Checked = ((_report.GraphOptions & graphOption) == graphOption);

            //chkValues
            graphOption       = OlapReport.GraphOptionsEnum.ShowValues;
            chkValues.Checked = ((_report.GraphOptions & graphOption) == graphOption);

            //chkSeries
            graphOption       = OlapReport.GraphOptionsEnum.ShowSeries;
            chkSeries.Checked = ((_report.GraphOptions & graphOption) == graphOption);

            //chkCat
            graphOption    = OlapReport.GraphOptionsEnum.ShowCategories;
            chkCat.Checked = ((_report.GraphOptions & graphOption) == graphOption);
        }