private void XCONTA_Rpt022_Rpt_BeforePrint(object sender, System.Drawing.Printing.PrintEventArgs e)
        {
            try
            {
                lblEmpresa.Text = param.NombreEmpresa;

                string                    msg   = "";
                XCONTA_Rpt022_Bus         Bus   = new XCONTA_Rpt022_Bus();
                List <XCONTA_Rpt022_Info> lista = new List <XCONTA_Rpt022_Info>();


                DateTime FechaIni;
                DateTime FechaFin;
                string   IdCentroCosto          = "";
                int      IdPuntoCargo           = 0;
                int      IdPuntoCargo_Grupo     = 0;
                bool     Mostrar_Reg_en_cero    = true;
                bool     Mostrar_CC             = false;
                bool     Mostrar_asiento_cierre = false;

                /*
                 * IdNivel_a_mostrar = 3;
                 * FechaIni = new DateTime ( 2017, 01, 01 );
                 * FechaFin = new DateTime(2017, 01, 31);
                 */
                FechaIni            = Convert.ToDateTime(P_Fecha_ini.Value);
                FechaFin            = Convert.ToDateTime(P_Fecha_fin.Value);
                lblFecha_corte.Text = "Al " + FechaFin.ToLongDateString();
                IdPuntoCargo        = Convert.ToInt32(P_IdPuntoCargo.Value);
                IdPuntoCargo_Grupo  = Convert.ToInt32(P_IdPuntoCargo_grupo.Value);

                IdCentroCosto          = Convert.ToString(P_IdCentroCosto.Value);
                IdNivel_a_mostrar      = Convert.ToInt32(P_IdNivel_a_mostrar.Value);
                Mostrar_Reg_en_cero    = Convert.ToBoolean(P_Mostrar_reg_en_cero.Value);
                Mostrar_CC             = Convert.ToBoolean(P_Mostrar_CC.Value);
                Mostrar_asiento_cierre = Convert.ToBoolean(P_Mostrar_asiento_cierre.Value);


                lista = Bus.consultar_data(param.IdEmpresa, FechaIni, FechaFin,
                                           IdCentroCosto, IdNivel_a_mostrar, IdPuntoCargo_Grupo, IdPuntoCargo, Mostrar_Reg_en_cero, Mostrar_CC, Mostrar_asiento_cierre, param.IdUsuario, ref msg);
                this.DataSource = lista;
            }
            catch (Exception ex)
            {
                Log_Error_bus.Log_Error(ex.ToString());
                Core.Erp.Info.Log_Exception.LoggingManager.Logger.Log(Core.Erp.Info.Log_Exception.LoggingCategory.Error, ex.Message);
                throw new Core.Erp.Info.Log_Exception.DalException(string.Format("", "XCONTA_Rpt001_rpt_BeforePrint", ex.Message), ex)
                      {
                          EntityType = typeof(XCONTA_Rpt001_rpt)
                      };
            }
        }
        private void XCONTA_Rpt019_Rpt_BeforePrint(object sender, System.Drawing.Printing.PrintEventArgs e)
        {
            try
            {
                XCONTA_Rpt019_Bus         BusRpt   = new XCONTA_Rpt019_Bus();
                List <XCONTA_Rpt019_Info> ListaRpt = new List <XCONTA_Rpt019_Info>();

                DateTime FechaIni, FechaFin;
                bool     Mostrar_Cero              = false;
                int      IdPunto_Cargo             = 0;
                int      IdPunto_Cargo_Grupo       = 0;
                string   IdCentroCosto             = "";
                bool     Mostrar_CC                = false;
                bool     Considera_asiento_cierrre = false;


                FechaIni                  = Convert.ToDateTime(this.PFechaIni.Value);
                FechaFin                  = Convert.ToDateTime(this.PFechaFin.Value);
                Mostrar_Cero              = Convert.ToBoolean(this.PMostrar_Reg_en_cero.Value);
                IdPunto_Cargo             = Convert.ToInt32(this.PIdPunto_Cargo.Value);
                IdPunto_Cargo_Grupo       = Convert.ToInt32(this.PIdPunto_Cargo_Grupo.Value);
                IdCentroCosto             = Convert.ToString(this.PIdCentroCosto.Value);
                Mostrar_CC                = Convert.ToBoolean(this.P_MostrarCC.Value);
                Considera_asiento_cierrre = Convert.ToBoolean(P_Mostrar_asiento_cierre.Value);
                lblEmpresa.Text           = param.NombreEmpresa;
                lblFecha_corte.Text       = "Al " + FechaFin.ToLongDateString();

                ListaRpt = BusRpt.Get_List_Reporte(param.IdEmpresa, FechaIni, FechaFin, IdCentroCosto,
                                                   IdPunto_Cargo_Grupo, IdPunto_Cargo, Mostrar_Cero, Mostrar_CC, Considera_asiento_cierrre, param.IdUsuario);
                this.DataSource = ListaRpt.ToArray();
            }
            catch (Exception ex)
            {
                Log_Error_bus.Log_Error(ex.ToString());
                Core.Erp.Info.Log_Exception.LoggingManager.Logger.Log(Core.Erp.Info.Log_Exception.LoggingCategory.Error, ex.Message);
                throw new Core.Erp.Info.Log_Exception.DalException(string.Format("", "XCONTA_NATU_Rpt001_Rpt_BeforePrint", ex.Message), ex)
                      {
                          EntityType = typeof(XCONTA_Rpt019_Rpt)
                      };
            }
        }