public InformeVentasProductosRpt GetVentasProductosReport(VentasList list, bool detallado) { InformeVentasProductosRpt doc = new InformeVentasProductosRpt(); List <VentasInfo> pList = new List <VentasInfo>(); foreach (VentasInfo item in list) { pList.Add(item); } doc.SetDataSource(pList); FormatHeader(doc); doc.EncabezadoDetallado.SectionFormat.EnableSuppress = !detallado; doc.Detalles.SectionFormat.EnableSuppress = !detallado; doc.PieDetallado.SectionFormat.EnableSuppress = !detallado; doc.Resumen.SectionFormat.EnableSuppress = detallado; doc.Encabezado.ReportObjects["Producto_LB"].ObjectFormat.EnableSuppress = detallado; doc.Encabezado.ReportObjects["Cliente_LB"].ObjectFormat.EnableSuppress = !detallado; doc.Encabezado.ReportObjects["Expediente_LB"].ObjectFormat.EnableSuppress = !detallado; doc.Encabezado.ReportObjects["Factura_LB"].ObjectFormat.EnableSuppress = !detallado; doc.Encabezado.ReportObjects["PMC_LB"].ObjectFormat.EnableSuppress = !detallado; return(doc); }
protected override void PrintAction() { PgMng.Reset(4, 1, Face.Resources.Messages.RETRIEVING_DATA, this); Library.Invoice.QueryConditions conditions = new Library.Invoice.QueryConditions(); conditions.Cliente = TodosCliente_CkB.Checked ? null : _client; conditions.Producto = TodosProducto_CkB.Checked ? null : _product; conditions.TipoProducto = TodosProducto_CkB.Checked ? (ETipoProducto)(long)TipoProducto_CB.SelectedValue : ETipoProducto.Todos; conditions.Serie = TodosSerie_CkB.Checked ? null : _serie; conditions.Expediente = TodosExpediente_CkB.Checked ? null : _expedient; conditions.TipoExpediente = TodosExpediente_CkB.Checked ? (ETipoExpediente)(long)TipoExpediente_CB.SelectedValue : ETipoExpediente.Todos; conditions.FechaIni = FInicial_DTP.Checked ? FInicial_DTP.Value : DateTime.MinValue; conditions.FechaFin = FFinal_DTP.Checked ? FFinal_DTP.Value : DateTime.MaxValue; bool detalle = TipoDetallado_RB.Checked; string filtro = GetFilterValues(); PgMng.Grow(); CommonReportMng reportMng = new CommonReportMng(AppContext.ActiveSchema, this.Text, filtro); if (Cliente_RB.Checked) { VentasList list = VentasList.GetListByCliente(conditions, detalle); PgMng.Grow(Face.Resources.Messages.BUILDING_REPORT); InformeVentasClientesRpt rpt = reportMng.GetVentasClientesReport(list, detalle); PgMng.FillUp(); ShowReport(rpt); } else if (Producto_RB.Checked) { VentasList list = VentasList.GetListByProducto(conditions, detalle); PgMng.Grow(Face.Resources.Messages.BUILDING_REPORT); InformeVentasProductosRpt rpt = reportMng.GetVentasProductosReport(list, detalle); PgMng.FillUp(); ShowReport(rpt); } else { VentasList list = VentasList.GetListByExpediente(conditions, detalle); PgMng.Grow(Face.Resources.Messages.BUILDING_REPORT); InformeVentasExpedientesRpt rpt = reportMng.GetVentasExpedienteReport(list, detalle); PgMng.FillUp(); ShowReport(rpt); } _action_result = DialogResult.Ignore; }