Example #1
0
        public virtual CrystalDecisions.CrystalReports.Engine.ReportDocument CreateReport()
        {
            ReporteFacturas rpt = new ReporteFacturas();

            rpt.Site = this.Site;
            return(rpt);
        }
Example #2
0
        public void CargarDatos(FacturaBL facturaBL, ClientesBL clientesBl)
        {
            var bindingSource = new BindingSource();

            bindingSource.DataSource =
                from f in facturaBL.ListadeFacturas
                select new
            {
                Id       = f.Id,
                Fecha    = f.Fecha,
                Cliente  = clientesBl.Listaclientes.FirstOrDefault(r => r.Id == f.ClienteId).Nombre,
                SubTotal = f.SubTotal,
                Impuesto = f.Impuesto,
                Total    = f.Total
            };

            var reporte = new ReporteFacturas();

            reporte.SetDataSource(bindingSource);

            crystalReportViewer1.ReportSource = reporte;
            crystalReportViewer1.RefreshReport();
        }