0

I have a MVC project and I want to create a report using Stimulsoft Ultimate. I've seen samples that use a direct connection and execute a query to get data from the database. But I have a list of objects in my c# code that I want to use for the report. Is that possible? how?

UPDATE: This is what I have done so far:

    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);
    }

but in the last line (return ...) I get the following error.

    System.ArgumentNullException: Value cannot be null.
    Parameter name: value
maro
  • 29
  • 6

1 Answers1

0

You should add next section to the web.config file:

  <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>
HighAley
  • 1,257
  • 1
  • 8
  • 20
  • Nope, it won't help! Any other idea? [I'm facing the same issue](http://stackoverflow.com/q/31633320/3967440) – Akbari Aug 02 '15 at 08:20
  • HighAley, I posted a question, too: [Creating Readonly Variables in Stimulsoft](http://stackoverflow.com/q/35328033/153923). I hope you can help. –  Feb 10 '16 at 23:30
  • You should change the versions to those that you use. – HighAley Feb 11 '16 at 11:09