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

            rpt.Site = this.Site;
            return(rpt);
        }
Exemple #2
0
        private void Btn_informe_ButtonClick(object sender, EventArgs e)
        {
            if (this.ValidarGuardar())
            {
                List <PresupDataSource> presupuesto = new List <PresupDataSource>();
                presupuesto = this.negocioPresupuesto.DevolverPresu(txt_anio.Text, txt_cuenta.Text, int.Parse(txt_centro.Text), Program.compa);
                EmpresaDataSource empresa = new EmpresaDataSource();
                empresa = this.negocioEmpresa.DevolverDatosEmpresa(Program.compa);
                List <PresupShowDataSourceReporte> presupR = new List <PresupShowDataSourceReporte>();
                foreach (PresupDataSource item in presupuesto)
                {
                    PresupShowDataSourceReporte presupDev = new PresupShowDataSourceReporte();
                    presupDev.Anio          = item.Anio;
                    presupDev.NombreMes     = CultureInfo.CurrentCulture.DateTimeFormat.GetMonthName(item.IdMes).ToUpper();
                    presupDev.Cuenta        = item.Cuenta + " - " + item.NombreCuenta;
                    presupDev.IdCentro      = Convert.ToString(item.IdCentro) + " - " + item.NombreCentro;
                    presupDev.Presupuesto   = item.Presupuesto;
                    presupDev.NombreEmpresa = empresa.Nombrecia + " - " + empresa.NombreSucursal;
                    presupDev.NitEmpresa    = empresa.NitCia + " - " + empresa.DigitoCia;
                    presupDev.Fecha         = fecha_informepres.Value.ToShortDateString();
                    presupR.Add(presupDev);
                }

                ReportePresupuesto reportpresup = new ReportePresupuesto();
                reportpresup.SetDataSource(presupR);
                crystal_Presupuesto.ReportSource = reportpresup;
                this.Size = new Size(1003, 583);
                crystal_Presupuesto.Size         = new Size(987, 519);
                this.crystal_Presupuesto.Visible = true;
                this.lbl_cuenta.Visible          = false;
                this.lbl_anio.Visible            = false;
                this.txt_anio.Visible            = false;
                this.txt_descripcentro.Visible   = false;
                this.txt_nombrecuenta.Visible    = false;
                txt_cuenta.Visible        = false;
                lbl_centro.Visible        = false;
                txt_centro.Visible        = false;
                lbl_fecha.Visible         = false;
                fecha_informepres.Visible = false;
                this.CenterToScreen();
            }
        }