コード例 #1
0
        public BIDashboard()
        {
            InitializeComponent();
            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");
            }
            ConnectionHelper.Instance.UseConnectionName = false;
            ConnectionHelper.Instance.ConnectionName    = BIDashboardModel.Initialize(path);

            this.UpdateReports();
            this.InitializeDetectTileDeletion();

            this.DefaultReport();
            this.tileViewControl.Maximized += new TileViewControl.TileViewEventHandler(tileViewControl_StateChanged);
            this.tileViewControl.Minimized += new TileViewControl.TileViewEventHandler(tileViewControl_StateChanged);

            this.DataContext = this;
        }
コード例 #2
0
        public BIDashboard()
        {
            InitializeComponent();
            string path = System.IO.Path.GetFullPath(@"Assets\Config\OLAPSample.config");

            ConnectionHelper.Instance.UseConnectionName = false;
            ConnectionHelper.Instance.ConnectionName    = BIDashboardModel.Initialize(path);

            this.UpdateReports();
            this.InitializeDetectTileDeletion();

            this.DefaultReport();
            this.tileViewControl.Maximized += new TileViewControl.TileViewEventHandler(tileViewControl_StateChanged);
            this.tileViewControl.Minimized += new TileViewControl.TileViewEventHandler(tileViewControl_StateChanged);

            this.DataContext = this;
        }
コード例 #3
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);
        }
コード例 #4
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));
                }
            }
        }
コード例 #5
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      = System.IO.Path.GetFullPath(@"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
            });
        }