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

如何在報(bào)告中設(shè)置過濾器 Power BI 嵌入式 javascri

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

問題描述

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

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>

我認(rèn)為要添加的過濾器在此行之后: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);

推薦答案

要過濾您的嵌入報(bào)告,您必須構(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]  
};

有關(guān)配置嵌入元素的詳細(xì)信息,請參閱 嵌入配置詳細(xì)信息 并查看有關(guān)如何使用不同過濾器類型和應(yīng)用它們的更多信息,請參閱 過濾器.

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.

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

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

相關(guā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(如何讓我的機(jī)器人提及發(fā)出該機(jī)器人命令的人)
How to fix Must use import to load ES Module discord.js(如何修復(fù)必須使用導(dǎo)入來加載 ES 模塊 discord.js)
How to list all members from a specific server?(如何列出來自特定服務(wù)器的所有成員?)
Discord bot: Fix ‘FFMPEG not found’(Discord bot:修復(fù)“找不到 FFMPEG)
Welcome message when joining discord Server using discord.js(使用 discord.js 加入 discord 服務(wù)器時的歡迎消息)
主站蜘蛛池模板: 欧美精品一二三区 | 日本午夜精品 | 国产一级免费在线观看 | 成人精品一区二区 | 久草视频网站 | 精品日韩一区二区 | 夜夜草导航 | 精品国产一区二区三区久久久四川 | 色射综合| 麻豆精品国产91久久久久久 | 午夜精品久久久 | 狠狠躁夜夜躁人人爽天天高潮 | 福利av在线 | 中文在线一区二区 | 日韩视频一区二区 | 国产成人精品一区二区三区网站观看 | 在线观看精品视频网站 | 欧美 日韩 在线播放 | 中文字幕亚洲无线 | 夜夜爆操 | 午夜丰满少妇一级毛片 | 99久久精品免费视频 | 久久精品中文字幕 | 黄网免费 | 国产一区二区三区 | 日韩中文字幕网 | 欧美日韩一区精品 | 欧美理论片在线 | 在线观看中文视频 | 国产精品一区三区 | 91视频免费在观看 | 亚洲精品久久视频 | 一级黄色生活视频 | 欧美午夜精品 | 久久不卡视频 | 亚洲成人精品在线观看 | 欧美久久一区二区 | 久草免费在线视频 | 久久久久久久夜 | 欧美久久国产精品 | 手机av在线|