Exemple #1
0
        private void Bind()
        {
            this.SelectedControl.Report = this.SelectedReport;

            var control = (from TileViewItem t in this.tileViewControl.Items
                           where t.Header.ToString() == this.SelectedControl.Header
                           select t).FirstOrDefault();

            if (control != null)
            {
                string path = System.IO.Path.GetFullPath(@"Assets\Config\OLAPSample.config");
                if (this.SelectedControl.ControlType == "Chart")
                {
                    (control.Content as OlapChart).OlapDataManager = OlapDataSourceHelper.GetManager(this.SelectedControl.Report.ReportFileName, BIDashboardModel.Initialize(path));
                }
                else if (this.SelectedControl.ControlType == "Grid")
                {
                    (control.Content as OlapGrid).OlapDataManager = OlapDataSourceHelper.GetManager(this.SelectedControl.Report.ReportFileName, BIDashboardModel.Initialize(path));
                }
                else if (this.SelectedControl.ControlType == "Gauge")
                {
                    (control.Content as OlapGauge).OlapDataManager = OlapDataSourceHelper.GetManager(this.SelectedControl.Report.ReportFileName, BIDashboardModel.Initialize(path));
                }
            }
        }
Exemple #2
0
        /// <summary>
        /// Helps to create a control for a tile.
        /// </summary>
        /// <param name="controlType"></param>
        /// <param name="tile"></param>
        /// <returns></returns>
        private FrameworkElement CreateControl(Tile tile)
        {
            var    controlType = tile.ControlType;
            string path        = System.IO.Path.GetFullPath(@"Assets\Config\OLAPSample.config");

            switch (controlType)
            {
            case "Chart":
                OlapChart olapChart = new OlapChart()
                {
                    OlapDataManager = OlapDataSourceHelper.GetManager(tile.Report.ReportFileName, BIDashboardModel.Initialize(path))
                };
                olapChart.Loaded += new RoutedEventHandler(olapChart_Loaded);
                return(olapChart);

            case "Grid":
                return(new OlapGrid()
                {
                    Style = (Style)FindResource("olapGridStyle"),
                    OlapDataManager = OlapDataSourceHelper.GetManager(tile.Report.ReportFileName, BIDashboardModel.Initialize(path))
                });

            case "Gauge":
                OlapGauge olapGauge = new OlapGauge()
                {
                    OlapDataManager = OlapDataSourceHelper.GetManager(tile.Report.ReportFileName, BIDashboardModel.Initialize(path))
                };
                SkinStorage.SetVisualStyle(olapGauge, "Office2007Blue");
                return(olapGauge);
            }

            return(null);
        }
Exemple #3
0
        private void DefaultReport()
        {
            Tile tile = new Tile();

            tile.Header = "OlapChart";
            this.DashboardReport.Tiles.Add(tile);
            tile.Report      = this.DashboardReport.Reports.ElementAt(1);
            tile.ControlType = "Chart";
            string path = "";

            if (AppDomain.CurrentDomain.BaseDirectory.Contains("Binaries_"))
            {
                path = System.IO.Path.GetFullPath(@"..\..\common\Assets\Config\OLAPSample.config");
            }
            else
            {
                path = System.IO.Path.GetFullPath(@"..\..\..\common\Assets\Config\OLAPSample.config");
            }
            OlapChart olapChart = new OlapChart()
            {
                OlapDataManager = OlapDataSourceHelper.GetManager(tile.Report.ReportFileName, BIDashboardModel.Initialize(path))
            };

            olapChart.Loaded += new RoutedEventHandler(olapChart_Loaded);
            this.tileViewControl.Items.Add(new TileViewItem
            {
                Header            = tile.Header,
                Tag               = olapChart,
                TileViewItemState = tile.TileState,
                Content           = olapChart
            });
        }