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

            rpt.Site = this.Site;
            return(rpt);
        }
Example #2
0
        private void btnImprimir_Click(object sender, EventArgs e)
        {
            Formulario formulario = FormularioBL.obtenerFormulario("AL-T-TR", ref error, ref mensaje);

            if (!error)
            {
                try
                {
                    AlprotecdbEntities db             = new AlprotecdbEntities();
                    CRTrabajadores     crTrabajadores = new CRTrabajadores();
                    crTrabajadores.SetDataSource(db.Trabajador.Select(t => new
                    {
                        CedulaIdentidad = t.cedulaIdentidad,
                        Nombre          = t.nombre,
                        Cargo           = t.cargo,
                        Telefono        = t.telefono,
                        Movil           = t.movil,
                        Direccion       = t.direccion
                    }).ToList());
                    crTrabajadores.SetParameterValue("CodigoFormulario", formulario.codigo);
                    crTrabajadores.SetParameterValue("NombreFormulario", formulario.nombre);
                    crTrabajadores.SetParameterValue("AproboFormulario", formulario.aprobo);
                    crTrabajadores.SetParameterValue("NumeroEdicionFormulario", formulario.numeroEdicion.ToString());
                    FrmReportes frmReportes = new FrmReportes();
                    frmReportes.crvReportes.ReportSource = crTrabajadores;
                    frmReportes.ShowDialog();
                }
                catch (Exception ex)
                {
                    MessageBox.Show("OcurriĆ³ un error.", "Alprotec", MessageBoxButtons.OK, MessageBoxIcon.Error);
                }
            }
            else
            {
                MessageBox.Show("OcurriĆ³ un error.", "Alprotec", MessageBoxButtons.OK, MessageBoxIcon.Error);
            }
        }