Search results

Bold BI Dashboards Embedding in ASP.NET MVC Sample with Embedded SDK

We have created an ASP.NET MVC sample with Embedded SDK, here we could list the dashboards and render the dashboard based on your selection after passing the authorization.

NOTE: The best way to get started would be reading the Getting Started section of the documentation to start using first. The Getting Started guide gives you enough information that you need to know before working on the sample.

How to run the sample

  1. Download the ASP.NET MVC sample from here.

  2. In the ASP.NET MVC sample, you could find the EmbedProperties class file in the Models folder. Embed Properties

  3. In EmbedProperties.cs, you need to set the following properties.

    RootUrl Dashboard Server BI URL (ex: http://localhost:5000/bi,
    SiteIdentifier For Bold BI Enterprise edition, it should be like `site/site1`. For Bold BI Cloud, it should be empty string.
    Environment Your Bold BI application environment. (If Cloud, you should use `cloud`, if Enterprise, you should use `enterprise`)
    UserEmail UserEmail of the Admin in your Bold BI, which would be used to get the dashboards list
    UserPassword Password of the Admin in Bold BI, which would be used to get the dashboards list
    EmbedSecret You could get your EmbedSecret key from Embed tab by enabling `Enable embed authentication` in Administration page as mentioned in next step
  1. You can get your Embed Secret key from the administrator setting section. Please refer to this link for more details.

  2. Then, run your ASP.NET MVC sample.

How this sample works

  1. Based on the values provided in the EmbedProperties.cs, we would get the user token and validate it, and then we could get the dashboards list from the server.

  2. In HomeController.cs, we have added the GetToken() method and GetDashboards() action, which has been called when initializing the DOM in Index.html. Get Dashboards

  3. When you are selecting the dashboard to render, we would authorize the server URL by calling the GetEmbedDetails action with the provided EmbedProperties values. Get Embed Details

  4. In the above authorization, we have generated the SignatureUrl with the provided EmbedSecret key and validate embed details in Bold BI. Then only, the dashboard would be rendered in the viewer-section of index.cshtml.