How to display data in ReportViewer using aspx page in MVC project? RRS feed

  • Question

  • User1804735465 posted

    I'm using ReportViewer control for the first time and got an issue. I added aspx page to my MVC project:

    <script runat="server">
        protected void Page_Load(object sender, EventArgs e)
            AbstractModel.UnitOfWork _unitOfWork = (AbstractModel.UnitOfWork)System.Web.HttpContext.Current.Items["uow"];
            IEnumerable data = _unitOfWork.VisitsReportRepo.GetData("01.01.2001", "10.09.2013", "0286");
            if (!Page.IsPostBack)
                LocalReport localReport = ReportViewer1.LocalReport;
                ReportDataSource ds2 = new ReportDataSource("VisitReportDataSet", data);
    <head runat="server">
    <form runat="server">
            <asp:ScriptManager ID="ScriptManager1" runat="server">
            <rsweb:ReportViewer ID="ReportViewer1" runat="server" Font-Names="Verdana"
                Font-Size="8pt" InteractiveDeviceInfos="(Коллекция)"
                WaitMessageFont-Names="Verdana" WaitMessageFont-Size="14pt"
                <LocalReport ReportPath = "Views\Reports\Report039y.rdlc">

    The problem is that my ReportViewer do not display any data, however localReport

     accepts the DataSource and contains all the data i need. VisitReportDataSet is my DataSet and ReportViewer has ReportPath to my rdlc

     report. What am I doing wrong? I'll appreciate any help!

    Tuesday, September 10, 2013 7:29 AM

All replies