我有一个 MVC 项目,我想使用 Stimulsoft Ultimate 创建一个报告。我见过使用直接连接并执行查询以从数据库中获取数据的示例。但是我的 c# 代码中有一个对象列表,我想用于报告。那可能吗?如何?
更新:这是我到目前为止所做的:
public ActionResult Report()
{
string FilePath = "..\\Report.mrt";
report.Load(Server.MapPath(FilePath));
report.Compile();
report["ShamsiCurrDate"] = myGlobalVariables.DateNow;
var Data = GetDataFromDB();
report.Render();
return StiMvcViewer.GetReportSnapshotResult(HttpContext, report);
}
但在最后一行(return ...)我收到以下错误。
System.ArgumentNullException: Value cannot be null.
Parameter name: value