private void ApplicatoinBind() { PowerBIMaintainUCO UCO = new PowerBIMaintainUCO(); TB_EAI_PowerBIApplication Data = UCO.GetTB_EAI_PowerBIApplication(); if (Data != null) { hfApplicationID.Value = Data.ApplicationID; txtApplicationID.Text = Data.ApplicationID; txtApplicationDesc.Text = Data.ApplicationDesc; txtUserName.Text = Data.UserName; txtPassword.Text = Data.Password; txtAuthorityUrl.Text = Data.AuthorityUrl.Replace("https://login.microsoftonline.com/", "").Replace("/", ""); lblAuthorityUrl2.Text = Data.AuthorityUrl; txtResourceUrl.Text = Data.ResourceUrl; txtApiUrl.Text = Data.ApiUrl; } else { hfApplicationID.Value = ""; txtApplicationID.Text = ""; txtApplicationDesc.Text = ""; txtUserName.Text = ""; txtPassword.Text = ""; txtAuthorityUrl.Text = ""; lblAuthorityUrl2.Text = "https://login.microsoftonline.com//"; txtResourceUrl.Text = "https://analysis.windows.net/powerbi/api"; txtApiUrl.Text = "https://api.powerbi.com/"; } }
private async Task GetReport() { PowerBIMaintainUCO UCO = new PowerBIMaintainUCO(); TB_EAI_PowerBIApplication App = UCO.GetTB_EAI_PowerBIApplication(); TB_EAI_PowerBIReport Report = UCO.GetTB_EAI_PowerBIReportOne(new TB_EAI_PowerBIReport() { ApplicationID = App.ApplicationID, ReportNO = Request["Report"] }); await this._embedService.EmbedReport( "", Report.WorkSpaceID, Report.ReportID, App.AuthorityUrl, App.ResourceUrl, Report.ApplicationID, App.ApiUrl, App.UserName, App.Password); ScriptManager.RegisterStartupScript( this.Page , this.Page.GetType() , Guid.NewGuid().ToString() , string.Format("onSuccess('{0}','{1}','{2}');" , this._embedService.EmbedConfig.EmbedToken.Token , this._embedService.EmbedConfig.EmbedUrl , this._embedService.EmbedConfig.Id) , true); }