Page 1 of 1

Adding Licence Key to .NET Core app using NodeServices

Posted: Thu Oct 19, 2017 7:30 am
by MichalCh
Hello,

I'm using the .NET Core app report exporting from server side with NodeServices with implemented exportPdf.js and exportHtml.js from Demo Project. I've added in every controller and in every place this piece of code Stimulsoft.Base.StiLicense.Key = "MyKey" and even in .js files but still the "TRIAL" is being displayed. I can add that the key is correct since adding it into the Demo Project removes the "TRIAL" keyword.

What should I do?

Regards

Re: Adding Licence Key to .NET Core app using NodeServices

Posted: Fri Oct 20, 2017 8:55 am
by HighAley
Hello, Michal.

The JS report engine is used in node.js.
You should set the Key there.
Please, look at the sample:

Code: Select all

module.exports = function (callback, reportFile) {
  var Stimulsoft = require("stimulsoft-reports-js");

  Stimulsoft.Base.StiLicense.key =
    "6vJhGtLLLz2GNviWm.....";

  Stimulsoft.Base.StiFontCollection.addOpentypeFontFile("./Content/Roboto-Black.ttf");

  var report = new Stimulsoft.Report.StiReport();
  report.loadFile(reportFile);

  report.renderAsync(function () {
    var data = report.exportDocument(Stimulsoft.Report.StiExportFormat.Pdf);
    var error = null;
    callback(error, data);
  });
}
Thank you.

Re: Adding Licence Key to .NET Core app using NodeServices

Posted: Fri Oct 20, 2017 12:26 pm
by MichalCh
Hello HighAley,

Everything works perfectly, thank you!

Cheers

Re: Adding Licence Key to .NET Core app using NodeServices

Posted: Sat Oct 21, 2017 12:39 am
by Edward
Hi Michal,

You are very welcome, let us know if any help is required.

Thank you,
Edward