lier rapport à reportviewer web mvc2

J'ai asp.net MVC2 application.
Je suis à l'aide de VS2008 et voulez brancher rapport généré à partir de mon contrôleur de reportviewer.

des idées?

pour l'instant j'ai ce code
"Contrôleur"

//should pass data to report
 public ActionResult GenerateReport()
      {


        LocalReport report = new LocalReport();
        report.ReportPath = Server.MapPath("~/Reports/KingsCourt.rdlc");

        List<InvoiceRow> rows = new List<InvoiceRow>();

        rows.Add(new InvoiceRow { name = "Testing item", value = (decimal)25.85 });
        rows.Add(new InvoiceRow { name = "Testing item2", value = (decimal)5.15 });
        ReportDataSource source = new ReportDataSource("InvoiceRow", rows);
        report.DataSources.Add(source);

        ViewData["InvoiceRow"] = report;
        return View();
      }

et Afficher la page:

 <form id="form1" runat="server">

  <h2>GenerateReport</h2>
  <rsweb:ReportViewer ID="ReportViewer1" runat="server" Font-Names="Verdana" 
      Font-Size="8pt" Height="400px" Width="400px">
    <LocalReport ReportPath="Reports\KingsCourt.rdlc">
      <DataSources>
        <rsweb:ReportDataSource DataSourceId="ObjectDataSource1" Name="InvoiceRow" />
      </DataSources>
    </LocalReport>


  </rsweb:ReportViewer>    

  <asp:ObjectDataSource ID="ObjectDataSource1" runat="server" SelectMethod="Rows" 
      TypeName="Accounts.Classes.Invoices"></asp:ObjectDataSource>
 </form>

OriginalL'auteur cpoDesign | 2011-03-14