0

我有一个 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
4

1 回答 1

0

您应该将下一部分添加到web.config文件中:

  <runtime>
    <assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
      <dependentAssembly>
        <assemblyIdentity name="System.Web.Mvc" publicKeyToken="31bf3856ad364e35" />
        <bindingRedirect oldVersion="1.0.0.0-2.0.0.0" newVersion="3.0.0.1" />
      </dependentAssembly>
    </assemblyBinding>
  </runtime>
于 2015-06-30T13:51:02.137 回答