コード例 #1
0
        private static void Test_GetDashboard(PBIAPIClient pbic)
        {
            PBIGroup     group     = pbic.GetGroupByID("75c2b5c8-b698-4480-ad48-97a190cf67ee");
            PBIDashboard dashboard = group.GetDashboardByID("56ce2b48-9e5c-4ecc-a8aa-a65b7b6bfdc4");
            PBITile      tile      = dashboard.Tiles[0];

            Console.WriteLine(dashboard.DisplayName);
        }
コード例 #2
0
        private static void Test_Tiles(PBIAPIClient pbic)
        {
            PBIGroup myGroup = pbic.Groups[0];

            PBIDashboard dashboard = myGroup.Dashboards[0];

            PBITile tile = dashboard.Tiles[0];

            Console.WriteLine(tile.ToString());
        }
コード例 #3
0
        public ActionResult DataDashboard()
        {
            // Model for Power BI Dashboard Information
            PbiDashboardInfo dashboardInfo = new PbiDashboardInfo();

            //Test for AuthenticationResult
            if (Session["authResult"] != null)
            {
                //Get the authentication result from the session
                AuthResult = (AuthenticationResult)Session["authResult"];

                dashboardInfo.UserId        = AuthResult.UserInfo.DisplayableId;
                dashboardInfo.AccessToken   = AuthResult.AccessToken;
                dashboardInfo.TileEmbedURLs = new List <string>();

                // Get Dashboard
                PBIDashboard dashboard = GetDashboardByDisplayName(DashboardName);
                if (dashboard != null)
                {
                    dashboardInfo.DashboardId = dashboard.id;

                    // Get Tile
                    PBITile tile = GetTileByTitle("fcwindow", dashboard.id);
                    dashboardInfo.TileEmbedURLs.Add(tile.embedUrl);

                    tile = GetTileByTitle("flwindow", dashboard.id);
                    dashboardInfo.TileEmbedURLs.Add(tile.embedUrl);

                    tile = GetTileByTitle("avgfc", dashboard.id);
                    dashboardInfo.TileEmbedURLs.Add(tile.embedUrl);

                    tile = GetTileByTitle("histo", dashboard.id);
                    dashboardInfo.TileEmbedURLs.Add(tile.embedUrl);
                }
            }
            else
            {
                // TODO:
                // Redirect auf Startseite oder Seite wo man SignIn machen kann
            }

            //return View(model: AuthResult.AccessToken);
            return(View(model: dashboardInfo));
        }