In this article, we will discuss how to activate components by specifying a license key. We will consider activation examples for various platforms and frameworks, along with their features.

Where can I get a license key?

After purchasing the subscription/license, you can obtain a license key by downloading it from your personal/company account. To log in to your account, use the username and password that were provided during the product subscription purchase. Within the Subscription section, you will discover a 'How to Activate' button. By clicking on this button, you will be directed to the next page where you can either copy the activation key in string format or download the license file containing the activation key. Components that have been activated with a key can be deployed in any project, even if there is no an internet connection.

NOTE:

For JS components, there is the possibility to generate a license key that is linked to a specific domain name. This license key will not activate Stimulsoft components on any other domain name.

What activation methods are available?

The complete array of activation methods depends on the component and the framework it operates within. In the majority of cases, you can activate a component using a key from either a file or a string. However, for certain reporting components, activation options also encompass the utilization of a byte array, stream, or assembly.

Reporting and Dashboard Tools for WinForms (Windows Forms)

Subscriptions required:
Please activate the license using the form method before initializing the component.

Form1.cs
public partial class Form1 : Form
{
	public Form1()
	{
		//Activation with using license code
		Stimulsoft.Base.StiLicense.Key = "Your activation code...";

		//Activation with using license file
		Stimulsoft.Base.StiLicense.LoadFromFile("license.key");

		//Activation from byte array
		Stimulsoft.Base.StiLicense.LoadFromBytes(bytes);

		//Activation from stream
		Stimulsoft.Base.StiLicense.LoadFromStream(stream);

		//Activation from assembly
		Stimulsoft.Base.StiLicense.LoadFromEntryAssembly(assembly, "stimulsoft-license.key");

		InitializeComponent();
	}
}

Reporting and Dashboard Tools for Windows Presentation Foundation (WPF)

Subscriptions required:
Activate the license in the MainWindow method before initializing the component.

MainWindows.xaml.cs
public partial class MainWindow : Window
{
	public MainWindow()
	{
		//Activation with using license code
		Stimulsoft.Base.StiLicense.Key = "Your activation code...";

		//Activation with using license file
		Stimulsoft.Base.StiLicense.LoadFromFile("license.key");

		//Activation from byte array
		Stimulsoft.Base.StiLicense.LoadFromBytes(bytes);

		//Activation from stream
		Stimulsoft.Base.StiLicense.LoadFromStream(stream);

		//Activation from assembly
		Stimulsoft.Base.StiLicense.LoadFromEntryAssembly(assembly, "stimulsoft-license.key");

		InitializeComponent();
	}
}

Reporting and Dashboard Tools for ASP.NET WebForms

Subscriptions required:
Activate the license in the static constructor of a class.

Default.aspx.cs
public partial class _Default : Page
{
	static _Default()
	{
		//Activation with using license code
		Stimulsoft.Base.StiLicense.Key = "Your activation code...";

		//Activation with using license file
		var path = HttpContext.Current.Server.MapPath("license.key");
		Stimulsoft.Base.StiLicense.LoadFromFile(path);
	}
}

Reporting and Dashboard Tools for ASP.NET MVC

Subscriptions required:
Activate the license in the static constructor of a controller.

HomeController.cs
public class HomeController : Controller
{
	static HomeController()
	{
		//Activation using license code
		Stimulsoft.Base.StiLicense.Key = "Your activation code...";

		//Activation using license file
		var path = System.Web.HttpContext.Current.Server.MapPath("~/Content/license.key");
		Stimulsoft.Base.StiLicense.LoadFromFile(path);
	}
}

Reporting and Dashboard Tools for ASP.NET Core MVC

Subscriptions required:
Activate the license in the static constructor of a controller.

HomeController.cs
//Activation using license code
public class HomeController : Controller
{
	static HomeController()
	{
		Stimulsoft.Base.StiLicense.Key = "Your activation code...";
	}
}

//Activation using license file
public class HomeController : Controller
{
	public HomeController(IHostingEnvironment hostEnvironment)
	{
		var path = Path.Combine(hostEnvironment.ContentRootPath, "Content\\license.key");
		Stimulsoft.Base.StiLicense.LoadFromFile(path);
	}
}

Reporting and Dashboard Tools for ASP.NET Core Razor

Subscriptions required:
Activate the license in the static constructor of a page.

Index.cshtml.cs
//Activation using license code
public class IndexModel : PageModel
{
	static IndexModel()
	{
		Stimulsoft.Base.StiLicense.Key = "Your activation code...";
	}
}

//Activation using license file
public class IndexModel : PageModel
{
	public IndexModel(IWebHostEnvironment webHostEnvironment)
	{
		var path = Path.Combine(webHostEnvironment.ContentRootPath, "Content\\license.key");
		Stimulsoft.Base.StiLicense.LoadFromFile(path);
	}
}

Reporting and Dashboard Tools for Blazor Server

Subscriptions required:
Activate the license in the page initialization event.

Index.razor
@using Stimulsoft.Report
@using Stimulsoft.Report.Blazor
@using Stimulsoft.Report.Web

<StiBlazorViewer />

@code
{
	protected override void OnInitialized()
	{
		//Activation using license code
		Stimulsoft.Base.StiLicense.Key = "Your activation code...";

		//Activation using license file
		Stimulsoft.Base.StiLicense.LoadFromFile("Content/license.key");

		base.OnInitialized();
	}
}

Reporting and Dashboard Tools for Blazor WebAssembly (Wasm)

Subscriptions required:
Activate the license in the page initialization event.

Index.razor
@using Stimulsoft.Report
@using Stimulsoft.Report.Blazor
@using Stimulsoft.Report.Web

<StiBlazorViewer />

@code
{
	protected override void OnInitialized()
	{
		//Activation using license code
		Stimulsoft.Base.StiLicense.Key = "Your activation code...";

		base.OnInitialized();
	}
}

Reporting Tools for Angular

Subscriptions required:
  • Stimulsoft Reports.WEB to activate reporting components;
  • Stimulsoft Ultimate, which serves as a comprehensive solution for activating reporting and data analytics components, along with the PDF form generation component.

Activate the license in the controller constructor.

ViewerController.cs
//Activation using license code
public class ViewerController : Controller
{
	public ViewerController()
	{
		Stimulsoft.Base.StiLicense.Key = "Your activation code...";
	}
}

//Activation using license file
public class ViewerController : Controller
{
	public ViewerController(IWebHostEnvironment hostEnvironment)
	{
		var path = Path.Combine(hostEnvironment.ContentRootPath, "Content\\license.key");
		Stimulsoft.Base.StiLicense.LoadFromFile(path);
	}
}

Reporting and Dashboards Tools for JavaScript (JS)

Subscriptions required:
Activate the license before creating, loading and building a report, using the viewer and designer.

index.html
function Start() {

	//Activation using license code
	Stimulsoft.Base.StiLicense.key = "Your activation code...";

	//Activation using license file
	Stimulsoft.Base.StiLicense.loadFromFile("license.key");	
}

Reporting and Dashboards Tools for PHP (including Laravel)

Subscriptions required:
Activate the license in the event handler.

index.php
//Activation using license code
<?php
	$handler = new \Stimulsoft\StiHandler();
	$handler->license->setKey('Your activation code...');
	$handler->renderHtml();
?>

//Activation using license file
<?php
	$handler = new \Stimulsoft\StiHandler();
	$handler->license->setFile('license.key');
	$handler->renderHtml();
?>

An option exists to download a license key using JavaScript code on the project page. It is necessary to add this code before creating, loading, and rendering a report, as well as prior to utilizing the viewer and designer.

index.html
function Start() {

	//Activation using license code
	Stimulsoft.Base.StiLicense.key = "Your activation code...";

	//Activation using license file
	Stimulsoft.Base.StiLicense.loadFromFile("license.key");	
}

Reporting Tool for Java

Subscriptions required:
  • Stimulsoft Reports.JAVA to activate reporting components;
  • Stimulsoft Ultimate, which serves as a comprehensive solution for activating reporting and data analytics components, along with the PDF form generation component.

Activate the license using a string license key or using a license key file, for example, in a *.jsp file before using the viewer and designer.

index.jsp
<body>
	<%
		//Activation using license code
		com.stimulsoft.base.licenses.StiLicense.setKey("Your activation code...");

		//Activation using license file
		com.stimulsoft.base.licenses.StiLicense.loadFromFile(
			request.getSession().getServletContext().getRealPath("/license/license.key")
		);
	%>
	<stiwebviewer:webviewer report="${report}" options="${options}" />
</body>

PDF Forms

Subscriptions required:
  • Stimulsoft PDF Forms to activate the form creation component;
  • Stimulsoft Ultimate, which serves as a comprehensive solution for activating reporting and data analytics components, along with the PDF form generation component.

Activate the license in the static constructor of a controller.

HomeController.cs
//Activation using license code
public class HomeController : Controller
{
	static HomeController()
	{
		Stimulsoft.Base.StiLicense.Key = "Your activation code...";
	}
}

//Activation using license file
public class HomeController : Controller
{
	public HomeController(IHostingEnvironment hostEnvironment)
	{
		var path = Path.Combine(hostEnvironment.ContentRootPath, "Content\\license.key");
		Stimulsoft.Base.StiLicense.LoadFromFile(path);
	}
}
Should you have any inquiries regarding the activation of Stimulsoft components, please feel free to get in touch with us.
By using this website, you agree to the use of cookies for analytics and personalized content. Cookies store useful information on your computer to help us improve efficiency and usability. For more information, please read the privacy policy and cookie policy.