久久久久久久av_日韩在线中文_看一级毛片视频_日本精品二区_成人深夜福利视频_武道仙尊动漫在线观看

如何在報告中設置過濾器 Power BI 嵌入式 javascri

How to set filters in reports power BI embedded javascript(如何在報告中設置過濾器 Power BI 嵌入式 javascript)
本文介紹了如何在報告中設置過濾器 Power BI 嵌入式 javascript的處理方法,對大家解決問題具有一定的參考價值,需要的朋友們下面隨著小編來一起學習吧!

問題描述

我想在我的報告 power bi 嵌入式上添加一些過濾器,我有一個 html 文件,我需要在 javascript 中添加一些過濾器,但我沒有開發(fā)經(jīng)驗.我只需要看一個例子就知道如何添加它.

I want to add somes filters on my reports power bi embedded, i have an html file, and i need to add somes filters in javascript but i dont have experience as a developer. I just need to see an exemple to see how to add it.

<head>  `enter code here`
    <meta http-equiv="Content-type" content="text/html; charset=utf-8">  
    <meta name="viewport" content="width=device-width,initial-scale=1">  
    <title>test</title>  

    <script type="text/javascript" language="javascript" src="https://code.jquery.com/jquery-1.12.4.js"></script>  
    <script type="text/javascript" language="javascript" src="https://rawgit.com/Microsoft/PowerBI-JavaScript/master/dist/powerbi.min.js"></script>  


</head>  

<body>  
    <h1>test</h1>  
    <div id="reportContainer" style="width: 80%; height: 800px;"></div>  
</body>  

<script>  
    $(document).ready(function () {  
        var getEmbedToken = "https://testclienttest.azurewebsites.net/api/HttpTrigger1?code=XXXXXXXXXXXXXXXXXXX/XXXXXXXXXXXXX==";  

        $.ajax({  
            url: getEmbedToken,  
            jsonpCallback: 'callback',  
            contentType: 'application/javascript',  
            dataType: "jsonp",  
            success: function (json) {  

                var models = window['powerbi-client'].models;  

                var embedConfiguration = {  
                    type: 'report',  
                    id: json.ReportId,  
                    embedUrl: json.EmbedUrl,  
                    tokenType: models.TokenType.Embed,  
                    accessToken: json.EmbedToken  
                };  

                var $reportContainer = $('#reportContainer');  
                var report = powerbi.embed($reportContainer.get(0), embedConfiguration);


            },  
            error: function () {  
                alert("Error");  
            }  
        });  

    });  
</script>  

</html>

我認為要添加的過濾器在此行之后:var report = powerbi.embed($reportContainer.get(0), embedConfiguration);

i think the filters to add is after this line : var report = powerbi.embed($reportContainer.get(0), embedConfiguration);

推薦答案

要過濾您的嵌入報告,您必須構(gòu)造一個或多個過濾器并將它們作為數(shù)組傳遞給 JavaScript 客戶端 - 在 filtersembedConfiguration 的屬性,或作為 report/page/visual setFilters 的參數(shù)方法.

To filter your embed report, you must construct one or more filters and pass them as array to the JavaScript client - either in filters property of embedConfiguration, or as a parameter to report/page/visual setFilters method.

過濾器可以是以下類型之一:

The filters can be from one of these types:

  • IBasicFilter
  • 高級過濾器
  • IRelativeDateFilter
  • ITTopNFilter
  • IIncludeExcludeFilter

例如,過濾名為 Product 的表以僅顯示數(shù)據(jù),其中 Count 列為 1、2 或 3,可以如下構(gòu)造:

For example, to filter table named Product to show only data, where Count column is 1, 2 or 3 can be constructed as follows:

const basicFilter: pbi.models.IBasicFilter = {
  $schema: "http://powerbi.com/product/schema#basic",
  target: {
    table: "Product",
    column: "Count"
  },
  operator: "In",
  values: [1,2,3],
  filterType: 1 // pbi.models.FilterType.BasicFilter
}

然后修改您的代碼以將此過濾器傳遞給 embedConfiguration:

Then modify your code to pass this filter to embedConfiguration:

var embedConfiguration = {  
    type: 'report',  
    id: json.ReportId,  
    embedUrl: json.EmbedUrl,  
    tokenType: models.TokenType.Embed,  
    accessToken: json.EmbedToken,
    filters: [basicFilter]  
};

有關配置嵌入元素的詳細信息,請參閱 嵌入配置詳細信息 并查看有關如何使用不同過濾器類型和應用它們的更多信息,請參閱 過濾器.

For more information about configuring the embed element, see Embed Configuration Details and to see more information on how to use different filter types and applying them, see Filters.

這篇關于如何在報告中設置過濾器 Power BI 嵌入式 javascript的文章就介紹到這了,希望我們推薦的答案對大家有所幫助,也希望大家多多支持html5模板網(wǎng)!

【網(wǎng)站聲明】本站部分內(nèi)容來源于互聯(lián)網(wǎng),旨在幫助大家更快的解決問題,如果有圖片或者內(nèi)容侵犯了您的權(quán)益,請聯(lián)系我們刪除處理,感謝您的支持!

相關文檔推薦

discord.js v12: How do I await for messages in a DM channel?(discord.js v12:我如何等待 DM 頻道中的消息?)
how to make my bot mention the person who gave that bot command(如何讓我的機器人提及發(fā)出該機器人命令的人)
How to fix Must use import to load ES Module discord.js(如何修復必須使用導入來加載 ES 模塊 discord.js)
How to list all members from a specific server?(如何列出來自特定服務器的所有成員?)
Discord bot: Fix ‘FFMPEG not found’(Discord bot:修復“找不到 FFMPEG)
Welcome message when joining discord Server using discord.js(使用 discord.js 加入 discord 服務器時的歡迎消息)
主站蜘蛛池模板: 在线免费观看日本 | 久久久久黑人 | 亚洲精品av在线 | 亚洲国产成人精品女人久久久 | 日韩欧美在线观看视频网站 | 9191在线观看 | 日韩高清不卡 | 欧美亚洲在线视频 | 国产高清视频在线观看 | 天天操天天干天天曰 | 亚洲欧美国产精品久久 | 国产高清视频一区二区 | 国产99久久 | 日韩在线小视频 | 午夜亚洲 | 狠狠色狠狠色综合日日92 | 五月天激情综合网 | 久久综合一区二区三区 | 在线日韩视频 | 免费在线看黄 | 美女视频h| 日韩亚洲视频 | 欧美成人精品激情在线观看 | 亚洲av毛片成人精品 | japanhdxxxx裸体 | 一级做a爰片久久毛片 | 一区二区精品在线 | 日韩一二区在线观看 | 精品国产一区二区三区免费 | 日本特黄a级高清免费大片 特黄色一级毛片 | 亚洲一区二区三区在线免费 | 欧美日韩国产一区二区 | 亚洲精品免费视频 | 羞羞视频在线观看 | 欧洲一区二区三区 | 免费一区二区三区 | 一区二区在线免费观看视频 | 国产精品国产a级 | 日本三级全黄三级a | 国产精品一区二区三区在线 | 性高朝久久久久久久3小时 av一区二区三区四区 |