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); }
protected void Page_Load(object sender, EventArgs e) { ((Master_DialogMasterPage)this.Master).Button1OnClick += CDS_PowerBI_Setting_ModifyPowerBI_Button1OnClick; ((Master_DialogMasterPage)this.Master).Button2Text = ""; if (!IsPostBack) { hfApplicationID.Value = Request["ApplicationID"].ToString(); if (Request["Mode"].ToString() == "Insert") { txtReportID.Text = ""; txtReportDesc.Text = ""; txtReportNO.Text = ""; txtWorkSpaceID.Text = ""; } if (Request["Mode"].ToString() == "Update") { txtReportID.Text = Request["ReportID"].ToString(); txtReportDesc.Text = ""; txtReportNO.Text = ""; txtWorkSpaceID.Text = Request["WorkSpaceID"].ToString(); TB_EAI_PowerBIReport Data = UCO.GetTB_EAI_PowerBIReportOne( new TB_EAI_PowerBIReport() { ApplicationID = hfApplicationID.Value, ReportID = txtReportID.Text, WorkSpaceID = txtWorkSpaceID.Text }); if (Data != null) { txtReportDesc.Text = Data.ReportDesc; txtReportNO.Text = Data.ReportNO; hfReportID.Value = Data.ReportID; hfWorkSpaceID.Value = Data.WorkSpaceID; } } } }
protected void Page_Load(object sender, EventArgs e) { if (!IsPostBack) { // 系統管理者 PowerBI查閱者 if (!new BaseUCO().IsUserInRoles(new[] { "SystemAdmin", "PowerBIUser" })) { Response.Redirect("~/Default.aspx"); } PowerBIMaintainUCO UCO = new PowerBIMaintainUCO(); TB_EAI_PowerBIReport Report = UCO.GetTB_EAI_PowerBIReportOne(new TB_EAI_PowerBIReport() { ReportNO = Request["Report"] }); AddSiteMapNode("我的首頁", "~/Homepage.aspx"); AddSiteMapNode("大數據分析"); AddSiteMapNode("大數據分析"); AddSiteMapNode(Report.ReportDesc, "~/CDS/PowerBI/Setting/PowerBIReport.aspx?Report=" + Report.ReportNO); Page.RegisterAsyncTask(new PageAsyncTask(GetReport)); } }