Пример #1
0
        private void BtnImprResultados_Click(object sender, EventArgs e)
        {
            Reportes.FrmReportes          frmImprResultados = new Reportes.FrmReportes();
            Reportes.CrsRprImprResultados cr = new Reportes.CrsRprImprResultados();

            using (ModelContainer conexion = new ModelContainer())
            {
                var dt = conexion.PuntajePreguntas.Where(p => p.ExamenIdExamen == idExamenActual).Select(p => new { p.numeroDePregunta, p.sp1 });

                cr.SetDataSource(dt);
            }

            TextObject alumno            = (TextObject)cr.ReportDefinition.Sections["Section1"].ReportObjects["TxtRptAlumno"];
            TextObject porcentaje        = (TextObject)cr.ReportDefinition.Sections["Section1"].ReportObjects["TxtRptPorcentaje"];
            TextObject examenSelecionado = (TextObject)cr.ReportDefinition.Sections["Section1"].ReportObjects["TxtRptExamenSelecionado"];
            TextObject correctas         = (TextObject)cr.ReportDefinition.Sections["Section1"].ReportObjects["TxtRptCorrectas"];
            TextObject numeroPreguntas   = (TextObject)cr.ReportDefinition.Sections["Section1"].ReportObjects["TxtRptTotalPreguntas"];

            alumno.Text            = LblAlumno.Text;
            porcentaje.Text        = LblPercentage.Text;
            examenSelecionado.Text = LblSelectedExam.Text;
            correctas.Text         = LblCorrect.Text;
            numeroPreguntas.Text   = LblTotal.Text;

            frmImprResultados.crystalReportViewer1.ReportSource = cr;
            frmImprResultados.Show();
        }
Пример #2
0
        private void ImprimirDetalles()
        {
            Reportes.FrmReportes        frmImprDetalles = new Reportes.FrmReportes();
            Reportes.CrsRprImprDetalles cr = new Reportes.CrsRprImprDetalles();

            using (ModelContainer conexion = new ModelContainer())
            {
                var dt = conexion.PuntajePreguntas.Where(p => p.ExamenIdExamen == idExamenImprimir).Select(p => new { p.numeroDePregunta, p.sp1 });

                cr.SetDataSource(dt);
            }

            TextObject alumno            = (TextObject)cr.ReportDefinition.Sections["Section1"].ReportObjects["TxtRptAlumno"];
            TextObject porcentaje        = (TextObject)cr.ReportDefinition.Sections["Section1"].ReportObjects["TxtRptPorcentaje"];
            TextObject examenSelecionado = (TextObject)cr.ReportDefinition.Sections["Section1"].ReportObjects["TxtRptExamenSelecionado"];
            TextObject correctas         = (TextObject)cr.ReportDefinition.Sections["Section1"].ReportObjects["TxtRptCorrectas"];
            TextObject numeroPreguntas   = (TextObject)cr.ReportDefinition.Sections["Section1"].ReportObjects["TxtRptTotalPreguntas"];
            TextObject fecha             = (TextObject)cr.ReportDefinition.Sections["Section1"].ReportObjects["TxtRptFecha"];

            alumno.Text            = nombreAlumno + "  " + apellidoAlumno;
            porcentaje.Text        = this.porcentaje;
            examenSelecionado.Text = examen;
            correctas.Text         = preguntasCorrectas.ToString();
            numeroPreguntas.Text   = this.numeroPreguntas;
            fecha.Text             = this.fecha;

            frmImprDetalles.crystalReportViewer1.ReportSource = cr;
            frmImprDetalles.Show();
        }
Пример #3
0
        private void BtnImprCertificado_Click(object sender, EventArgs e)
        {
            Reportes.FrmReportes           frmImprCertificado = new Reportes.FrmReportes();
            Reportes.CrsRptImprCertificado cr = new Reportes.CrsRptImprCertificado();

            TextObject alumno            = (TextObject)cr.ReportDefinition.Sections["Section3"].ReportObjects["TxtRptAlumno"];
            TextObject porcentaje        = (TextObject)cr.ReportDefinition.Sections["Section4"].ReportObjects["TxtRptPorcentaje"];
            TextObject examenSelecionado = (TextObject)cr.ReportDefinition.Sections["Section5"].ReportObjects["TxtRptExamenSelecionado"];

            alumno.Text            = LblAlumno.Text;
            porcentaje.Text        = LblPercentage.Text;
            examenSelecionado.Text = LblSelectedExam.Text;

            frmImprCertificado.crystalReportViewer1.ReportSource = cr;
            frmImprCertificado.Show();
        }
Пример #4
0
        private void ImprimirPuntuacion()
        {
            Reportes.FrmReportes          frmImprPuntuacion = new Reportes.FrmReportes();
            Reportes.CrsRptImprPuntuacion cr = new Reportes.CrsRptImprPuntuacion();

            using (ModelContainer conexion = new ModelContainer())
            {
                var dt = DgvPuntuacion.DataSource;

                cr.SetDataSource(dt);
            }
            TextObject alumno = (TextObject)cr.ReportDefinition.Sections["Section1"].ReportObjects["TxtRangoFecha"];

            alumno.Text = rangoFecha;

            frmImprPuntuacion.crystalReportViewer1.ReportSource = cr;
            frmImprPuntuacion.Show();
        }