我正在使用 Razor Pages 网络应用程序 .Net Core 6。 我有一份报告(FastReport),我想在页面上显示。
代码如下: `
using FastReport.Report report = new ();
var reportPath = _env.WebRootFileProvider.GetFileInfo("Reports/ConsumerStatement.frx")?.PhysicalPath;
report.Load(reportPath);
report.RegisterData(data, "RefData");`
一切正常。在 .Net Core MVC 报告中成功显示: `返回视图(报告);
但我不知道如何在 Razor Pages 中显示此报告,因为 return Page() 不接受任何参数。
如何在剃须刀页面中显示此报告??
尝试使用 ViewBag/ViewData 作为 FastReport 的doc
将值传递给 razor 视图在页面模型中:
ViewBag.Report=report;
在 RazorView 中:
@ViewBag.Report.......