Adding Licence Key to .NET Core app using NodeServices

Stimulsoft Reports.NET discussion
Post Reply
MichalCh
Posts: 17
Joined: Fri Sep 22, 2017 7:37 am

Adding Licence Key to .NET Core app using NodeServices

Post 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
HighAley
Posts: 8430
Joined: Wed Jun 08, 2011 7:40 am
Location: Stimulsoft Office

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

Post 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.
MichalCh
Posts: 17
Joined: Fri Sep 22, 2017 7:37 am

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

Post by MichalCh »

Hello HighAley,

Everything works perfectly, thank you!

Cheers
Edward
Posts: 2913
Joined: Fri Jun 09, 2006 4:02 am

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

Post by Edward »

Hi Michal,

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

Thank you,
Edward
Post Reply