Beispiel #1
0
 public void generarReporteAspir(Aspirante aspir)
 {
     try{
         PsychoReportGenerator rGen = new PsychoReportGenerator(this.rutaArchivoGuardar, this.ad);
         aspir = ManejadorPruebas.GetResultados(aspir, this.ad.ds.Tables["resultadosceps"], this.ad.ds.Tables["resultadosraven"]);
         rGen.AgregarAspirante(aspir);
         rGen.Cerrar();
         MessageBox.Show("Archivo generado existosamente", "Aviso");
     }catch (Exception ex) {
         return;
     }
 }
Beispiel #2
0
        void Button1Click(object sender, EventArgs e)
        {
            if (this.rutaArchivoGuardar == "")
            {
                this.Button3Click(this, new EventArgs());
                if (this.rutaArchivoGuardar == "")
                {
                    return;
                }
            }
            string carreraSelected  = "";
            string facultadSelected = "";

            foreach (Carrera cr in this.carreras)
            {
                if (cr.NombreCarrera == this.cmbCarrera.Text)
                {
                    carreraSelected = cr.CodCarrera;
                    break;
                }
            }

            foreach (Facultad fc in this.facultades)
            {
                if (fc.NombreFacultad == this.cmbFacultad.Text)
                {
                    facultadSelected = fc.CodFacultad;
                    break;
                }
            }

            DataView vista     = this.ad.ds.Tables["aspirantes"].DefaultView;
            String   strFiltro = "anioregistrado=" + this.anioRegistrado;

            if (this.cmbFacultad.Text != "[Todas]")
            {
                strFiltro += " AND facultad= '" + facultadSelected + "'";
            }

            if (this.cmbCarrera.Text != "[Todas]")
            {
                strFiltro += " AND carrera= '" + carreraSelected + "'";
            }

            vista.RowFilter = strFiltro;
            try{
                this.cmbFacultad.Enabled = false;
                this.cmbCarrera.Enabled  = false;
                this.button1.Enabled     = false;
                this.button3.Enabled     = false;

                this.label1.Text = "Creando el documento " + this.rutaArchivoGuardar;
                PsychoReportGenerator rGen = new PsychoReportGenerator(this.rutaArchivoGuardar, this.ad);

                //int i = 0;
                foreach (DataRow fila in vista.ToTable().Rows)
                {
                    Aspirante currentAspir = manejadorAspirante.GetAspirante(fila["codigo"].ToString(), this.ad.ds);
                    this.label1.Text = "Agregando al reporte los datos del estudiante " + currentAspir.Apellidos + ", " + currentAspir.Nombres;
                    currentAspir     = ManejadorPruebas.GetResultados(currentAspir, this.ad.ds.Tables["resultadosceps"], this.ad.ds.Tables["resultadosraven"]);
                    rGen.AgregarAspirante(currentAspir);
                    //if(++i == 10) break;
                }
                rGen.Cerrar();
                MessageBox.Show("Archivo generado existosamente", "Aviso");
            }catch (Exception ex) {
                MessageBox.Show("Ocurrio un error al generar el reporte. Intentelo nuevamente", "Error");
            }
            this.Close();
        }