在.net核心中使用stimulsoft

问题描述 投票:1回答:1

到目前为止,我已经在我的.net项目中使用了stimulsoft没有问题,但是当我尝试将项目迁移到.net核心时,事情并没有奏效。这是我使用stimulsoft库的过程:

report = new StiReport();
report.Load("test.mrt");
report.Compile(); //--> here I get System.Windows.Forms load exception
MemoryStream memoryStream = new MemoryStream();
report.ExportDocument(StiExportFormat.Html, memoryStream); //--> here I get User32.dll load exception

首先,我在编译阶段遇到以下错误:

FileNotFoundException: Could not load file or assembly 'System.Windows.Forms, Culture=neutral, PublicKeyToken=null'. The system cannot find the file specified.

然后我评论编译行,但我在导出阶段出现以下错误:

DllNotFoundException: Unable to load DLL 'User32.dll': The specified module or one of its dependencies could not be found.

我从nuget安装了Stimulsoft.Reports.Web.NetCore2018.2.3。虽然此软件包的目标是.net核心,但仍依赖于平台相关模块。难道我做错了什么?有人可以帮忙吗?

PS:我在ubuntu 16.04上运行应用程序

.net-core ubuntu-16.04 stimulsoft
1个回答
0
投票

Stimulsoft.Reports.Web.NetCore尚不支持.NET Core上的StiReport.Compile()(自版本2018.2.3起)。

此方法对于报表中的C#代码是必需的(<Script>元素)。因此,如果您的报告依赖于内部的C#代码,您应该切换回.NET Framework和Stimulsoft.Reports.Net

或者只是删除带有Compile()调用的行,否则导出将在Windows上顺利运行(但报告中的C#代码没有进行任何动态修改)。

不幸的是,我没有在Linux下运行Stimulsoft报告的经验,所以不能告诉你对User32.dll的依赖。但你可以问支持者,他们反应灵敏。

最新问题
© www.soinside.com 2019 - 2024. All rights reserved.