Download the PHP package khoelck/phppowerbi without Composer

On this page you can find all versions of the php package khoelck/phppowerbi. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package phppowerbi

PhpPowerBI

PhpPowerBI is a simple library for working with PowerBI embedded reports directly from PHP. It leverages the microsoft/PowerBI-Javascript powerbi.js file for the actual rendering of the reports. It has not been included in this repo and must be downloaded separately here.

Dependencies

PhpPowerBI relies on PhpAzureAuth to generate auth tokens for Azure. If you install via Composer, it will automatically install this as a dependency. The above mentioned powerbi.js or powerbi.min.js file is also required.

Installation

The recommended way to install is via composer

Composer install

PhpPowerBI on Packagist

Manual install

Copy the contents of the src folder to your include_path, and include the libraries in your authentication script as below:

Initial Configuration

Each report you embed will need it's own JSON configuration file, based off of these parameters provided by Microsoft for calling the PowerBI API. This should be placed in your include_path along with the PowerBIConfig.php file. See EmbedExample.json for an example.

Be sure to include the powerbi.js or powerbi.min.js file in your page, before you call any methods from PHPPowerBI of course:

Use Case

You want to embed a PowerBI report in your PHP application - but you don't want to use the secure embed iframe option because it requires users to login. It would be better to obtain an Azure Token at time of login, then call the PowerBI API to display the report.

Leverage the AzureAuth API in your authentication script, which stores the token in your $_SESSION variable. Then, when calling the PowerBIRepot constructor, pass in the $_SESSION['Token'] variable to access and embed your report on the page.

Embedding Reports

The constructor for PowerBIReport takes 4 parameters:

Now, you can call one of two methods to embed the report:

  1. ShowReport - this will take one argument which is the element ID you wish to append the report to, and will render it automatically.

  2. ShowConfig - this will simply create a global constant with your report configuration that contains all of the necessary information to pass directly to the powerbi.embed function. The word Config will be appended to whatever you pass into this method for an parameter. You may want to use this if you intend to call powerbi.bootstrap on something first. For example, if you wanted to embed multiple reports in a modal or slideshow component, you could call powerbi.bootstrap on those elements, then call powerbi.embed when the reports should be shown. This can add better loading times to your embedded reports. Below is a very basic example:

Report Styling

You will need to add CSS for the report container, however there are additional options that should be configured in the JSON file. Many of the report options can be configured in the JSON configuration file for the report.

Related packages

PhpAzureAuth


All versions of phppowerbi with dependencies

PHP Build Version
Package Version
Requires khoelck/phpazureauth Version ^1.2
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package khoelck/phppowerbi contains the following files

Loading the files please wait ....