为了获得Asp.net MVC中的Pdf报告,我正在与Stimulsoft 2015合作 . 问题是我不知道如何转换我的代码以便在Asp.net Core中使用Stimulsoft Core . 似乎某些功能在Stimulsoft Core中不再可用(如StiReport) .
这是在Asp.net MVC中正常运行的代码
public ActionResult GetReportSnapshot(string sort)
{
StiReport report = new StiReport();
report.Load(Server.MapPath("~/Reports/Jobs.mrt"));
report["@PrjectId"] = 1;
report["@OrderBy"] = sort;
report.Dictionary.Variables["title"] = new Stimulsoft.Report.Dictionary.StiVariable("title", sort);
report.Render();
MemoryStream stream = new MemoryStream();
report.ExportDocument(StiExportFormat.Pdf, stream);
stream.Position = 0;
FileStreamResult fsr = new FileStreamResult(stream, "application/pdf");
return fsr;
}
我将不胜感激任何帮助 .
1 回答
你使用什么nuget包?可能是你缺少包含
StiReport
类的nuget包 . (我看到他们在多个nuget包上拆分他们的库)也可能是他们还没有将这部分迁移到dotnet核心 . 我建议你点击那里github repo,看看你是否能在那里找到任何信息:https://github.com/stimulsoft,或者在那里的网站上 .
通过nuget的外观,他们最近才开始迁移到dotnet核心,因此我认为我的第二个建议是正确的建议 .