After purchasing the product, you need to activate the license for the components you use. There are several ways to activate the license.

 

 

Activation using code

To activate using a string, just copy the encrypted license text from your account, and register it using the special setKey() function of the license property of the report object:

 

app.py

 

from stimulsoft_reports.report import StiReport

 

report = StiReport()

report.license.setKey('Your activation code...')

 

 

 

Activation using a license.key file

To activate using a license file, just download the license.key file from your account, and copy it to the Web project folder, for example, to the static folder with static files. Then, just register it using the special setFile() function of the license property of the report object:

 

app.py

 

from stimulsoft_reports.report import StiReport

 

report = StiReport()

report.license.setFile(url_for('static', filename='license.key'))

 

 

Information

 

The report viewer and report designer components also have the license property using which you can manage the license key in the way described above.

 

 

 

Protecting the license key

If you activate a license using a string, you can add its code under a certain condition. For example, the sessionID variable stores information about the current client session; you need to add a license key only for authorized users:

 

app.py

 

from stimulsoft_reports.report import StiReport

 

report = StiReport()

 

if sessionID != None:

   report.license.setKey('Your activation code...')

 

 

 

It would also work if you change the location and name of the license key file, for example:

 

app.py

 

from stimulsoft_reports.report import StiReport

 

report = StiReport()

report.license.setFile(url_for('private', filename='a15fc0ef64e6.key'))