Esempio n. 1
0
        public async Task <ActionResult> Dash(string dashId)
        {
            var pbi             = new PowerBiAuthentication(new powerbiWebToken());
            var dashboardClient = new DashboardClient(pbi);
            var dashes          = await dashboardClient.List();

            ViewBag.dashes      = dashes.value;
            ViewBag.accessToken = pbi.GetAccessToken();

            var firstDash = dashes.value.First(d => d.id == dashId);
            var tiles     = await dashboardClient.Tiles(firstDash.id);

            return(View("Index", model: tiles));
        }
Esempio n. 2
0
        private async static Task QueryDashboards()
        {
            var dashboardClient = new DashboardClient(pbi);
            var dashboards      = await dashboardClient.List();

            foreach (var dashboard in dashboards.value)
            {
                Console.WriteLine("{0}\t{1}", dashboard.displayName, dashboard.id);

                var tiles = await dashboardClient.Tiles(dashboard.id);

                foreach (var tile in tiles.value)
                {
                    Console.WriteLine(tile.embedUrl);
                }
            }
        }