After purchasing the product, you should activate license for used components. There are several ways of license key connection.

 

 

Activation using code string

To activate using a string, you should copy an encrypted license text from your personal account and register it in the event handler. You should place the code until you create and render your report.

 

index.php

 

<?php

$handler = new \Stimulsoft\StiHandler();

$handler->license->setKey('Your activation code...');

$handler->renderHtml();

?>

 

 

 

There is an option to load a license key using JavaScript code on the project page. You should place the code until you create and render your report.

 

index.php

 

Stimulsoft.Base.StiLicense.Key = "Your activation code...";

 

 

 

Activation using a file

To activate using a license file you should download the license.key file from your personal account, copy it to the folder of the PHP project, and register it in the event handler.

 

index.php

 

<?php

$handler = new \Stimulsoft\StiHandler();

$handler->license->setFile('license.key');

$handler->renderHtml();

?>

 

 

 

There is an option to load a license key using JavaScript code on the project page. You should place the code until you create and render your report.

 

index.php

 

Stimulsoft.Base.StiLicense.loadFromFile("license.key");

 

 

 

Protection against license key theft

If you activate license using a string, you can add its code by a certain condition. For example, you want to add a license key for registered users.

 

index.php

 

<?php

$handler = new \Stimulsoft\StiHandler();

if (!empty($sessionID))

$handler->license->setKey('Your activation code...');

$handler->renderHtml();

?>

 

 

 

Also, we recommend you change the location and name of the license key file, for example:

 

license.php

 

<?php

$handler = new \Stimulsoft\StiHandler();

$handler->license->setFile('private/a15fc0ef64e6.key');

$handler->renderHtml();

?>