为了在 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;
}
Run Code Online (Sandbox Code Playgroud)
我将不胜感激任何帮助。