Member-only story

Integrating Vaadin Java Code with PowerBI JavaScript Code

Manpreet Singh
3 min readJul 14, 2023

--

Integrating PowerBI dashboards and reports into a Vaadin application can provide powerful data visualization capabilities. PowerBI offers a JavaScript API that allows embedding reports and interacting with them programmatically. In this article, we will explore how to integrate Vaadin Java code with PowerBI JavaScript code by separating the JavaScript code into a separate file.

Prerequisites

Before proceeding, make sure you have the following prerequisites in place:

  1. Vaadin development environment set up.
  2. PowerBI account and a workspace with the desired reports.

Step 1: Create the JavaScript File

  1. In your Vaadin project, navigate to the frontend directory. This directory is typically located at the same level as src directory in your Vaadin project.
  2. Create a new JavaScript file named powerbi.js in the frontend directory.
  3. Open the powerbi.js file and add the following PowerBI JavaScript code:
// powerbi.js

function initPowerBIReport(reportContainer, embedUrl, embedToken) {
var reportLoadConfig = {
type: 'report',
tokenType: 'Embed',
accessToken: embedToken,
embedUrl: embedUrl,
settings: {…

--

--

Manpreet Singh
Manpreet Singh

Written by Manpreet Singh

Software developer who loves writing about programming, technology, passive income strategies etc.

Responses (1)