public frmVistaReporteVentas(DataSet dsVentas) { InitializeComponent(); ReporteVentas reporte = new ReporteVentas(); reporte.SetDataSource(dsVentas); crvReporteVentas.ReportSource = reporte; }
private void btnGenerarRV_Click(object sender, EventArgs e) { dsVentas ventas = new dsVentas(); ReporteVentas reporteVentas = new ReporteVentas(); DateTime fechaInicio = cboFecIni.Value.Date; DateTime fechaFin = cboFecFin.Value.Date; ; ventas.Reporte.AddReporteRow(fechaFin.ToShortDateString(),fechaFin.ToShortDateString()); //todos los documentos de ventas en el rango de fechas IList<DocVenta> facturas = new DocVentaBL().findbyFechas(fechaInicio.ToShortDateString(),fechaFin.ToShortDateString()); ventas.Ventas.Rows.Clear(); if (facturas != null) if (facturas.Count > 0) { foreach (DocVenta factura in facturas) { if (factura.Documento.Estado == "ACTIVO") { string nro = factura.Documento.Id.ToString(); ventas.Ventas.AddVentasRow(nro,factura.Documento.FechaEmision.Value.ToShortDateString(), factura.Documento.Caja.Local.Nombre,(double)factura.Documento.Total); } } } else { Utils.Utils.Mensaje("No existen ventas en ese rango de fechas", MessageBoxButtons.OK, MessageBoxIcon.Exclamation); return; } new frmVistaReporteVentas(ventas).ShowDialog(this); }
public virtual CrystalDecisions.CrystalReports.Engine.ReportDocument CreateReport() { ReporteVentas rpt = new ReporteVentas(); rpt.Site = this.Site; return rpt; }