コード例 #1
0
        public ActionResult ReporteEmpleados()
        {
            ReportViewer rp = new ReportViewer();

            rp.ProcessingMode      = ProcessingMode.Local;
            rp.SizeToReportContent = true;
            string         sql = "SELECT Id, Serie, Matricula, Comentarios FROM Camiones";
            SqlDataAdapter adp = new SqlDataAdapter(sql, conex.EstablecerConexion());

            adp.Fill(ds, "Unidades");
            rp.LocalReport.ReportPath = Request.MapPath(Request.ApplicationPath) + @"Reportes/Report1.rdlc";
            rp.LocalReport.DataSources.Add(new ReportDataSource("Unidades", ds.Tables[0]));
            ViewBag.ReportViewer = rp;
            return(View());
        }