🍉 Meet Flexmonster Pivot Table & Charts 2.9.Check out all the hot features!
Get Free Trial

Error when using license key file

Javier González asked on November 19, 2019

I’m having some problems using a .txt file as a license key container. I’m using this:
report = new Flexmonster({
container: “report-container”,
componentFolder: “../scripts/flexmonster/”,
licenseFilePath: “../scripts/flexmonster/key.txt”,
toolbar: true,
fitGridlines: true,
beforetoolbarcreated: customizeToolbar,
customizeCell: function(cell, data) {
if (data && data.type == “header”) {
cell.attr[“title”] = data.escapedLabel;
reportcomplete: function() {
Is is reading the file correctly because if I put a wrong license I get the error:
Invalid license key.
Read more info about this error
You are trying to use the following key: axaxaxaxaxa
However, when using the correct license I get the javascript error that I have attached in a .png file.
Can you help me, please?


5 answers

Javier González November 19, 2019

Also tried to use:
licenseKey: “../scripts/flexmonster/key.txt”,
instead of:
licenseFilePath: “../scripts/flexmonster/key.txt”,
But then it doesn’t seem to recognize the path as a path, just as a string (and then it is obviously not correct.

Mykhailo Halaida Mykhailo Halaida Flexmonster November 19, 2019

Hi Javier,

Thank you for posting your question.

Please see our answer we’ve sent you via email.

Best regards,

Javier González November 20, 2019

Hello Mykhailo,

Actually, this error is not related to the wrong license key we got for our QA environment. That is already solved (thank you!).

I’m getting this error in our development environment, where we are using the development license and it’s been working perfectly but only if I put it directly on the code with:

The problem comes when I try to use a file with the license key inside, with:
licenseFilePath: “../scripts/flexmonster/key.txt”,

In this last case (which is the one we need, since we don’t want to show the license key in the HTML code) I get the attached Javascript error (Cannot read property ‘isEmpty’ of undefined) from jquery.

Thank you for your help.

Illia Yatsyshyn Illia Yatsyshyn Flexmonster November 20, 2019

Hello, Javier,
Thank you for your feedback.
We have investigated the issue, and we would like to kindly recommend you set the report only after the event ready is triggered.
The file with your key requires time to load. In case you invoke setReport API call earlier than your key is embedded, the error occurs.
Please, make sure you set the report later than the component is completely created. It can be simply tracked with the ready event. Find out more about the event here.
We hope it helps. If not, we would like to kindly ask you to provide more details about where setReport call is invoked.
Feel free to contact us in case of additional questions.
Kind Regards,

Javier González November 21, 2019

Hello Illia,
As you guessed, I was invoking the setReport API call directly after declaring the pivot variable (pivot = new Flexmonster({…});). Now, after waiting for the ready event to trigger it is working perfectly.
Thank you for your help!

This question is now closed