How to make report page default for different customers using Power BI API? - c#-4.0

We are embedding all our customers reports from power bi web to our own website and from there customers can view their insights/reports. Now, customers are requesting for default report page. so instead of viewing main page of report, they want to see their own report page as default. We have many customers, so we have to be done this for all of our customers. FYI: we are using c# for writing web services.
What are the ways of doing this? I believe we have to store report bookmarks guid in our database? if so then how can I access that bookmark guid?
so basically, do I need to create a table and store the customer id and bookmark guid for report page and whenever they access I should have to return that page guid according to customer id?
So is there anything to do from power bi API side or just need to make a changes from portal side?
Please suggest any possible ways of doing this.

If it is only about the page, then you can simply store the page name and switch to it programmatically by calling page's setActive method, or to set the page name to pageName property of the embed configuration details when embedding the report.
If you still want to apply bookmarks, then again you can apply it on load, or apply predefined state.

Related

Is it possible to show alert message on the page or popup window, when user SHARE the document

My SharePoint Environment is SharePoint 2019 On Premise
Is it possible to show alert message on the page or popup window, when user SHARE the document on the Document Library.
When we Share the document, whether or not we could modify the mail alert template/ Content.
Thanks
By 'share', I assume you mean you want to show a message anytime someone edits the permissions of a document. (Since technically, I could 'share' a document by emailing someone the link to it.)
To my knowledge, the only way to achieve this would be to build a custom-code (SPFx) solution which uses API's to interact with the document's permissions granted via app-only access. And block users' ability to access those documents in the traditional way through SharePoint. This would give you full control over the UI, and prevent users from granting access (sharing) elsewhere.
Another option you might investigate is Azure Rights Management. Sensitivity labels applied to documents/libraries can be configured to automatically display headers, footers, watermarks, and even encryption when they are accessed. Exchange can also be configured to display a 'tip', when it detects users are trying to email a sensitive document. Full disclosure: I have only worked with these features in SharePoint online and I'm not certain of their capability in an on-premise environment.

Secure filtering in Power BI Embedded

Currently I have the following scenario. I have a report in Power BI which reads from a dataset which has data of all companies. In my ASP .NET MVC application the user will select the company for which to display the report and with Power BI Embedded the application filters the report by the ID of the company through the embed config defined in JS (filter parameters passed from server).
I am using app owns data approach where I have a master account and the embed token is generated for the master account.
The user accessing the report does not have access rights to all companies and this is being handled server-side. With this approach however, the user can easily alter the embed config in JS and display the report for a company which he is not authorized to access.
I looked into row-level security and I found the following approach https://community.powerbi.com/t5/Developer/PowerBi-Embedded-API-Works-with-RLS/td-p/231064 where there exists a role for every company and the embed token is generated for that particular company. This would be an ideal approach but in my scenario the companies are not pre-defined and can be created any time. Therefore, I would need to create a role per company. This however cannot be achieved programmatically as Power BI does not provide means to automate role creation.
The only approach I can think of is to clone a report for each new company and create a dataset specific to that report which will only have the data for that particular company. Then the generated embed token will only be valid for that particular report.
Has anyone also experienced this dilemma? Any suggestions what I should do in such scenario?
You still can use RLS, but without roles per company. Use USERPRINCIPALNAME() DAX function to find out which user is viewing the report. In the database make a table to specify which company can be seen by which user and add it to your model. Then use RLS to filter this table to only the row (or rows) where user is current one (here is where USERPRINCIPALNAME() comes into play), and let the relationship between this table and your data tables to filter out what should not be seen. This way there will be no JavaScript filters at all, so nothing can be changed by some malicious user.
See Using the username() or userprincipalname() DAX function.

Embedded PowerBI in SharePoint - Targeted Audience?

I have a number of PowerBI dashboards on our SharePoint 2013 online site. We are working on a plan to only display relevant dashboards to the user based on their user group. For example, a salesperson will only see their personal dashboard on the page. I can do this for image viewer, etc., but I cannot figure out how to edit a PowerBI webpart to target an audience. Any suggestions would be most welcomed.
KL
I suggest you to use Row level security.
Select the Modeling tab.
Select Manage Roles.
3.Select Create
4.Provide a name for the role.
5.Select the table that you want to apply a DAX rule.
6.Enter the DAX expressions. This expression should return a true or false. For example: [UserID] = userprincipalname().
And Save.
For this you need a field where the username is registered, means that user has visibility on that row. If you don't have this information, then you will need to add some information to the row, to give visibility to whom deserve it.
After you have created your role, you can test the results of the role within Power BI Desktop. To do this, select View As Roles.
And then play around to check if what you get is what you want.
Hope that helps!
I had to revert the SP page to a Classic interface, then create individual Web Parts for each dashboard on the page, limiting each Web Part by the targeted audience. The Web Parts are not visible on the main Dashboard Portal page unless you are in the targeted audience, so you could see 1 or up to 5 dashboard previews on the page. An individual page was needed for each Power BI dashboard. A user cannot be prevented from seeing the dashboard if they are provided the URL, but hiding the hyperlink and preview screenshot on the Portal page is close enough. This should be easier to execute in SP... Oh well...

Pre-populate contact information

If a person has previously filled out a contact us form on our website, the next time they visit that form I would like their information pre-populated. Using Kentico EMS and the form builder, how can I make that happen?
you can access the contact informant via macros or custom macro methods and place it in the contact form default values (I would use an alternative form), but often you do not know if the user already exists unless they are logged in or enter the same email (which you would then need to add a client side trigger to Ajax an api once the email field is filled out, check for that contact in the api, return json of their info and populate the form).
to build the api you can either use the Kentico rest service or if you need more flexibility use the web part to api coupled with a repeater with custom query, adding the right where condition through macros.

Use Pictures from another website as SharePoint profile pictures

We have a "corporate directory" website that displays some contact information about our employees. Among other things like displaying data from Active Directory, it also displays a picture, which can be retrieve via a URL of the format http://[CorpDir]/PersonPhoto.aspx?email=[UserEmail]
I'm now looking for a way to use these pictures as profile pictures in SharePoint, as easy as possible. Custom coding for SharePoint is not an option for us at the moment.
The easiest way would be to set the PictureUrl property for each user profile. Even if you can't add custom code on the server to do that, you can probably write code elsewhere that uses the web services to set the profile.
You may also be able to do it with customization of the out of box AD import - take a look at the settings for that and what you have available in AD.

Resources