Stimulsoft.Reports.Web.NetCore部署

2023/10/21

这篇文章发布于 203 天前,部分信息可能已经发生变化。

需求

.NET 6网站需要展示和打印报表,打算用 Stimulsoft.Reports.Web.NetCore实现。

image-20231021105355563

准备

  1. 文件:stimulsoft.reports.web.netcore.2022.1.1.nupkg
  2. 许可文件:license.key

Visual Studio安装Stimulsoft.Reports.Web.NetCore

  1. 通过NuGet安装本地文件stimulsoft.reports.web.netcore.2022.1.1.nupkg
  2. 许可文件复制到Visual Studio项目(例如:wwwroot\license.key)

image-20231021104903427

  1. Controller读取许可文件
 static ViewerController()
 {
     // How to Activate
     //Stimulsoft.Base.StiLicense.Key = "6vJhGtLLLz2GNviWmUTrhSqnO...";
     //Stimulsoft.Base.StiLicense.LoadFromFile("license.key");
     //Stimulsoft.Base.StiLicense.LoadFromStream(stream);

     var directory = string.Format(Directory.GetCurrentDirectory() + "{0}wwwroot{0}", Path.DirectorySeparatorChar);
     Stimulsoft.Base.StiLicense.LoadFromFile(directory + "license.key");
 }

测试

WIN11 IIS+Ubuntu 20通过测试:

image-20231021105056886