发布时间 : 2023-09-12 11:10:50.623|阅读 136 次
概述:在本文中,我们已经介绍了部分产stimulsoft控件的激活方式,接下来继续向您介绍后续部分~
在上篇文章《报表工具Stimulsoft 激活集合,涵盖大部分控件激活方式(上)》在本文中,我们已经介绍了部分产stimulsoft控件的激活方式,接下来继续向您介绍后续部分~
需要订阅:
在页面初始化事件中激活许可证。
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(); } }
需要订阅:
在控制器构造函数中激活许可证。
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); } }
需要订阅:
在使用查看器和设计器创建、加载和构建报告之前激活许可证。
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"); }
需要订阅:
在事件处理程序中激活许可证。
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(); ?>
项目页面上存在使用 JavaScript 代码下载许可证密钥的选项。在创建、加载和呈现报表之前以及使用查看器和设计器之前,有必要添加此代码。
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"); }
需要订阅:
在使用查看器和设计器之前,使用字符串许可证密钥或使用许可证密钥文件(例如 *.jsp 文件中的许可证密钥文件)激活许可证。
需要订阅:
在控制器的静态构造函数中激活许可证。
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); } }
想要了解Stimulsoft Reports 报价信息的朋友,欢迎咨询慧都官方客服。
加入官方社群:740060302,欢迎相互交流