當前位置:
首頁 > 最新 > Power BI 內部部署報表嵌入

Power BI 內部部署報表嵌入

眾多用戶對報表都有嵌入需求,今天我們就來看看內部部署的powerbi報表如何進行簡單的嵌入。

我的測試環境訪問到Power BI 報表alldemo-1鏈接如下

http://biserver/reports/powerbi/AllDemo-1

需要嵌入報表,只需要在報表名後面加入參數:?rs:embed=true

既可以這樣訪問:http://biserver/reports/powerbi/AllDemo-1?rs:embed=true即可進行嵌入報表的鏈接

假設有門戶為

http://biserver:81/portal/index.html

此站點設置為windows身份驗證,登錄頁面為:

http://biserver:81/login.html

登錄過程如下:1、打開login.html2、輸入用戶名和密碼,跳轉到portal站點,此過後中模擬登陸了portal站點和powerbi站點3、portal站點嵌入了報表,即可打開站點。效果如下:登錄界面

portal界面,雖然做的很醜陋,但是效果實現就好了。

相關代碼如下,login頁面:

模擬登陸

varxmlHttp;

functioncreateXMLHttpRequest() {

if(window.ActiveXObject) {

xmlHttp=newActiveXObject("Microsoft.XMLHTTP");

}

elseif(window.XMLHttpRequest) {

xmlHttp=newXMLHttpRequest();

}

}

functionstartRequest() {

if(userid.value=="") {

alert("請輸入用戶名!");

userid.focus();

}

elseif(password.value=="") {

alert("請輸入密碼!");

password.focus();

}

else{

createXMLHttpRequest();

xmlHttp.onreadystatechange=handleStateChange;

xmlHttp.open("GET","http://biserver/reports/",true,userid.value,password.value);

xmlHttp.open("GET","http://biserver:81/portal/",true,userid.value,password.value);

xmlHttp.send(null);

}

}

functionhandleStateChange() {

if(xmlHttp.readyState==4) {

if(xmlHttp.status==200) {

window.location="http://biserver:81/portal/";

}

else{

alert("您的用戶名或者密碼不正確,請聯繫管理員!");

}

}

}

UserId:

Password:

Portal門戶代碼

portal門戶

報表

當然在開發上,很多用戶是不會滿足這樣的內容的。嵌入報表太簡單太粗暴。很多用戶希望有更多的功能,比如能夠嵌入視圖,能夠數據交互等功能。欣喜的告訴大家,下一個版本GA時候 PowerBI報表伺服器就能具備這些功能。


喜歡這篇文章嗎?立刻分享出去讓更多人知道吧!

本站內容充實豐富,博大精深,小編精選每日熱門資訊,隨時更新,點擊「搶先收到最新資訊」瀏覽吧!


請您繼續閱讀更多來自 Max講IT 的精彩文章:

TAG:Max講IT |