Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion demo/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@
"fetch": "^1.0.0",
"http-server": "^0.10.0",
"jquery": "^3.1.0",
"powerbi-client": "2.6.0",
"powerbi-client": "2.6.1",
"syntaxhighlighter": "4.0.1"
},
"devDependencies": {}
Expand Down
109 changes: 109 additions & 0 deletions demo/v2-demo/scripts/codesamples.js
Original file line number Diff line number Diff line change
Expand Up @@ -948,6 +948,115 @@ function _Report_ApplyCustomLayout() {
});
}

function _Report_HideAllVisualHeaders() {

// New settings to hide all the visual headers in the report
const newSettings = {
visualSettings: {
visualHeaders: [
{
settings: {
visible: false
}
// No selector - Hide visual header for all the visuals in the report
}
]
}
};

// Get a reference to the embedded report HTML element
var embedContainer = $('#embedContainer')[0];

// Get a reference to the embedded report.
report = powerbi.get(embedContainer);

// Update the settings by passing in the new settings you have configured.
report.updateSettings(newSettings)
.then(function () {
Log.log("Visual header was successfully hidden for all the visuals in the report.");
})
.catch(function (error) {
Log.log(errors);
});

}

function _Report_ShowAllVisualHeaders() {
// New settings to show all the visual headers in the report
const newSettings = {
visualSettings: {
visualHeaders: [
{
settings: {
visible: true
}
// No selector - Show visual header for all the visuals in the report
}
]
}
};

// Get a reference to the embedded report HTML element
var embedContainer = $('#embedContainer')[0];

// Get a reference to the embedded report.
report = powerbi.get(embedContainer);

// Update the settings by passing in the new settings you have configured.
report.updateSettings(newSettings)
.then(function () {
Log.log("Visual header was successfully shown for all the visuals in the report.");
})
.catch(function (error) {
Log.log(errors);
});

}

function _Report_HideSingleVisualHeader() {

// Define settings to hide the header of a single visual
var newSettings = {
visualSettings: {
visualHeaders: [
{
settings: {
visible: true
}
// No selector - Show visual header for all the visuals in the report
},
{
settings: {
visible: false
},
selector: {
$schema: "http://powerbi.com/product/schema#visualSelector",
visualName: "VisualContainer7"
// The visual name can be retrieved using getVisuals()
// Hide visual header for a single visual only
}
}
]
}
};

// Get a reference to the embedded report HTML element
var embedContainer = $('#embedContainer')[0];

// Get a reference to the embedded report.
report = powerbi.get(embedContainer);

// Update the settings by passing in the new settings you have configured.
report.updateSettings(newSettings)
.then(function () {
Log.log("Visual header was successfully hidden for 'Total Sales Variance by FiscalMonth and District Manager' visual.");
})
.catch(function (error) {
Log.log(errors);
});

}

function _Report_FullScreen() {
// Get a reference to the embedded report HTML element
var embedContainer = $('#embedContainer')[0];
Expand Down
12 changes: 12 additions & 0 deletions demo/v2-demo/scripts/step_embed.js
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,18 @@ function Report_ApplyCustomLayout() {
SetCode(_Report_ApplyCustomLayout);
}

function Report_HideAllVisualHeaders() {
SetCode(_Report_HideAllVisualHeaders);
}

function Report_ShowAllVisualHeaders() {
SetCode(_Report_ShowAllVisualHeaders);
}

function Report_HideSingleVisualHeader() {
SetCode(_Report_HideSingleVisualHeader);
}

// ---- Page Operations ----------------------------------------------------

function Page_SetActive() {
Expand Down
4 changes: 4 additions & 0 deletions demo/v2-demo/settings_interact_report.html
Original file line number Diff line number Diff line change
Expand Up @@ -54,10 +54,14 @@
</ul>
<li id="layout-operations" onclick="OpenLayoutOperations();"><a href="#">Layout</a>
<span class="tryShowcase" onclick="OpenLayoutOperations();onShowcaseTryMeClicked('CustomLayout');">(<span class="tryMeText">Showcase</span> <img src="images/tab_out.svg">)</span>
<div class="highlightSection"></div>
</li>
<ul id="layout-operations-ul" class="function-ul" style="display: none;">
<li onclick="Report_ApplyCustomLayout()" class="hideOnMobile hideOnReportCreate"><a href="#">Apply custom Layout</a></li>
<li onclick="Page_HasLayout()"><a href="#">Check layout</a></li>
<li onclick="Report_HideAllVisualHeaders()" class="hideOnMobile hideOnReportCreate"><a href="#">Hide all visual headers</a><div class="newFeature">NEW</div></li>
<li onclick="Report_ShowAllVisualHeaders()" class="hideOnMobile hideOnReportCreate"><a href="#">Show all visual headers</a><div class="newFeature">NEW</div></li>
<li onclick="Report_HideSingleVisualHeader()" class="hideOnMobile hideOnReportCreate"><a href="#">Hide single visual header</a><div class="newFeature">NEW</div></li>
</ul>
<li id="bookmarks-operations" onclick="OpenBookmarksOperations();" class="hideOnMobile"><a href="#">Bookmarks</a>
<span class="tryShowcase" onclick="OpenBookmarksOperations();onShowcaseTryMeClicked('Bookmarks');">(<span class="tryMeText">Showcase</span> <img src="images/tab_out.svg">)</span>
Expand Down
2 changes: 1 addition & 1 deletion dist/powerbi-client.d.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
/*! powerbi-client v2.6.0 | (c) 2016 Microsoft Corporation MIT */
/*! powerbi-client v2.6.1 | (c) 2016 Microsoft Corporation MIT */
declare module "util" {
/**
* Raises a custom event with event data on the specified HTML element.
Expand Down
146 changes: 142 additions & 4 deletions dist/powerbi.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading