I have a report on power bi which I published on the web and I will create a local page on my puter to view it through embed code and share it with others on dropbox.
I want to remove the button bar which has the social media links to prevent sharing.
Can I also prevent showing iframe source link?
using java script maybe.
please describe in detail ,because I am a data analyst and I can't write java script or html.
thanks
embed code:
<iframe width="600" height="373.5" src=";pageName=ReportSection2" frameborder="0" allowFullScreen="true"></iframe>
I have a report on power bi which I published on the web and I will create a local page on my puter to view it through embed code and share it with others on dropbox.
I want to remove the button bar which has the social media links to prevent sharing.
Can I also prevent showing iframe source link?
using java script maybe.
please describe in detail ,because I am a data analyst and I can't write java script or html.
thanks
embed code:
<iframe width="600" height="373.5" src="https://app.powerbi./view?r=eyJrIjoiYWYzNWU3NjktMjRmOC00NjdkLThlZjktZjEzODRhOWE3MTI4IiwidCI6IjFhYTk1NjRiLTE4YmUtNDU3YS04ZmFjLWEyOTZmNjdjMzU5OSJ9&pageName=ReportSection2" frameborder="0" allowFullScreen="true"></iframe>
Share
Improve this question
edited Oct 20, 2020 at 21:27
Sam Andreatta
2034 silver badges13 bronze badges
asked Oct 20, 2020 at 14:28
jennifer adamsjennifer adams
411 silver badge2 bronze badges
2
- You can't hide it, nor prevent people from sharing it. Publish to web makes your report and data public and everyone can see it. Don't do that with information that you want to keep private! – Andrey Nikolov Commented Oct 20, 2020 at 14:53
- You may wish to remove the live url from the question if you want to keep it private. If you wish to share it, I suggest purchasing Power BI licenses for the users – Jon Commented Oct 20, 2020 at 15:19
2 Answers
Reset to default 5You can absolutely hide it from the initial view. Ignore the not possible folks.
Once you use the Publish to Web feature (IFrame), place that URL in the code below and paste into your site. You will need to adjust the height and width to your desired look. The goal here is to use the clip:rect feature. Adjust the height (in this case, the 1040 is smaller than the original 1080) to restrict/cut off the footer.
<div id="content">
<div style="height:1080px;width:1920px">
<iframe width="1920" height="1080" src="PUT URL HERE" frameborder="0" style="position:absolute; clip:rect(0px,1920px,1040px,0px);
bottom:-0px; allowFullScreen=" true"=""></iframe>
</div>
</div>
Have you tried a reverse proxy where hijack the page and add styling to hide the bar? I've managed to achieve this with Cloudflare Workers.
Another benefit of this approach is you get the dashboard displayed from your own custom domain.
You will need a Cloudflare account where you configure a worker with the script below. If you set Cloudflare to be your NameServer then you can have a custom redirect on the worker with your domain name.
const upstream = 'app.powerbi.'
const upstream_path = '/'
// Whether to use HTTPS protocol for upstream address.
const https = true
// Whether to disable cache.
const disable_cache = true
addEventListener('fetch', event => {
event.respondWith(fetchAndApply(event.request));
})
class RemoveElement {
element(element) {
element.append(`
<style>
.embeddedLandingRootContentLogoVisible { height: 100% }
.logoBarWrapper { display: none }
</style>
`, { html: Boolean })
console.log(`Ining element: ${element.tagName}`)
}
}
async function fetchAndApply(request) {
const region = request.headers.get('cf-ipcountry').toUpperCase();
const ip_address = request.headers.get('cf-connecting-ip');
const user_agent = request.headers.get('user-agent');
let response = null;
let url = new URL(request.url);
let url_hostname = url.hostname;
if (https == true) {
url.protocol = 'https:';
} else {
url.protocol = 'http:';
}
var upstream_domain = upstream;
url.host = upstream_domain;
if (url.pathname == '/') {
url.pathname = upstream_path;
} else {
url.pathname = upstream_path + url.pathname;
}
let method = request.method;
let request_headers = request.headers;
let new_request_headers = new Headers(request_headers);
new_request_headers.set('Host', upstream_domain);
new_request_headers.set('Referer', url.protocol + '//' + url_hostname);
let original_response = await fetch(url.href, {
method: method,
headers: new_request_headers
})
response = new Response(original_response.body, original_response)
let original_text = null;
let response_headers = original_response.headers;
let new_response_headers = new Headers(response_headers);
let status = original_response.status;
if (disable_cache) {
new_response_headers.set('Cache-Control', 'no-store');
}
new_response_headers.set('access-control-allow-origin', '*');
new_response_headers.set('access-control-allow-credentials', true);
new_response_headers.delete('content-security-policy');
new_response_headers.delete('content-security-policy-report-only');
new_response_headers.delete('clear-site-data');
if (new_response_headers.get("x-pjax-url")) {
new_response_headers.set("x-pjax-url", response_headers.get("x-pjax-url").replace("//" + upstream_domain, "//" + url_hostname));
}
return new HTMLRewriter().on('body', new RemoveElement()).transform(response);
}
Once you're all set, the new embedded URL will be of the form: customdomain./view?r=eyJrIjE1NS00......
Please check this repo for further instructions: https://github./Hugoberry/PowerBI-nologo-proxy