TheDocumentation Index
Fetch the complete documentation index at: https://mintlify.com/LuisAMoralesA/tallerIngles-UAEMEcatepec/llms.txt
Use this file to discover all available pages before exploring further.
Reportes class (package controller) uses JasperReports 7 to generate PDF documents on demand. Reports are requested through the reportesServlet and streamed as application/pdf directly to the browser — no temporary files are written to disk. Compiled .jasper templates are stored in src/main/webapp/reports/.
Reportes implements the ReportesStruct interface and opens its own JDBC connection using the same BaseDatos.configuracionBD constants as BaseDatos.
Reportes disponibles
| Reporte | Archivo .jasper | Descripción |
|---|---|---|
| Bitácora de Alumnos | BitacorasDeAlumnos.jasper | Lista de alumnos de un grupo con nombre completo, usuario, teléfonos, email, ¿sale solo? y salón |
| Bitácora de Profesores | BitacoraProfesores.jasper | Lista de todos los profesores del plantel con datos de contacto y grupo asignado |
| Lista de Calificaciones | ListaCalificaciones.jasper | Calificaciones del grupo: 1er parcial, 2do parcial y promedio final |
| Lista de Seguimiento de Pago | ListaSeguimientoPago.jasper | Estado de pagos por alumno: inscripción y mensualidades 1–7 |
.jasper (runtime) and .jrxml (source) paths are declared in Constantes.Reportes:
Constantes.java
Cómo se generan los reportes
The following steps describe the full lifecycle of a report request:-
The user clicks a report button in
/view/listas/listaDocumentos.jsp, which sends aGETrequest to/reportesServletwith the appropriate query parameters (Attendance,Payment,Grade, or none for the teacher log). -
reportesServletdetermines the report type from the query parameters and sets the path to the corresponding.jasperfile usinggetServletContext().getRealPath("/reports/<file>.jasper"). Falls back to the relativeConstantes.Reportesconstant ifgetRealPathreturnsnull. -
A
Reportesinstance is created — its constructor opens a JDBC connection totallerdeingles. -
The servlet assembles the report parameters:
nombre_grupoandnombre_profesorare built by callingBaseDatos.concatenarDatosGrupo(id_teacher)andBaseDatos.concatenarDatosProfesor(id_teacher). Theruta_imagenespath is resolved to the server-side absolute path of theImages/directory. -
The
Reportesmethod (bitacorasDeAlumnos,listaCalificaciones,listasPagos, orbitacorasDeProfesores) is called. Internally it callsconexionBDReportes()again to ensure a fresh connection, then populates aMap<String, Object>of parameters. -
JasperFillManager.fillReport(reporteFinal, parametros, con)merges the compiled template with live database data via the openConnection. -
JRPdfExporterwrites the PDF bytes directly toresponse.getOutputStream(). The response is configured withContent-Type: application/pdfbefore the export. -
response.getOutputStream().flush()and.close()finalize the response. The JDBC connection is closed in thefinallyblock.
Método bitacorasDeAlumnos
Generates the student roster PDF for a specific teacher’s group.
Reportes.java
| Nombre | Tipo | Valor |
|---|---|---|
nombre_grupo | String | Nombre del grupo |
nombre_profesor | String | Nombre del profesor |
id_teacher_student | int | ID del profesor (filtro SQL interno del reporte) |
ruta_imagenes | String | Ruta absoluta al directorio Images/ |
classroom | String | Identificador del salón |
bitacoraAlumnos.pdf.
Método listaCalificaciones
Generates the grade list PDF for a teacher’s group.
Reportes.java
| Nombre | Tipo | Valor |
|---|---|---|
nombre_grupo | String | Nombre del grupo |
nombre_profesor | String | Nombre del profesor |
ruta_imagenes | String | Ruta absoluta al directorio Images/ |
PeriodoActual | String | Semestre activo |
id_teacher | int | ID del profesor (filtro SQL) |
listaCalificaciones.pdf.
Método listasPagos
Generates the payment tracking list PDF. This report is the most complex — it accepts variable month labels and count to render the correct number of payment columns.
Reportes.java
| Nombre | Tipo | Valor |
|---|---|---|
nombre_grupo | String | Nombre del grupo |
nombre_profesor | String | Nombre del profesor |
classroom | String | Identificador del salón |
ruta_imagenes | String | Ruta absoluta al directorio Images/ |
PeriodoActual | String | Semestre activo |
id_teacher | int | ID del profesor (filtro SQL) |
numMeses | String | Número total de meses del semestre |
listaMeses | String[] | Arreglo de nombres de meses (p. ej. ["Agosto","Septiembre",…]) |
listaPagos.pdf.
Método bitacorasDeProfesores
Generates the teacher log PDF. Unlike the other three reports, this one does not filter by group — it lists all teachers in the system.
Reportes.java
| Nombre | Tipo | Valor |
|---|---|---|
ruta_imagenes | String | Ruta absoluta al directorio Images/ |
PeriodoActual | String | Semestre activo |
bitacoraProfesores.pdf.
Plantillas JasperReports
Both the compiled.jasper binaries (used at runtime) and their XML source .jrxml files are committed in the repository under src/main/webapp/reports/. The .jasper files are loaded at request time via JRLoader.loadObjectFromFile(ruta).
| Archivo fuente | Archivo compilado |
|---|---|
BitacorasDeAlumnos.jrxml | BitacorasDeAlumnos.jasper |
BitacoraProfesores.jrxml | BitacoraProfesores.jasper |
ListaCalificaciones.jrxml | ListaCalificaciones.jasper |
ListaSeguimientoPago.jrxml | ListaSeguimientoPago.jasper |
- Edit the
.jrxmlsource file in JasperSoft Studio or a compatible editor. - Compile it to produce a new
.jasperbinary (JasperCompileManager.compileReport("file.jrxml")). - Replace the
.jasperfile insrc/main/webapp/reports/and redeploy.
The
ruta_imagenes parameter is the absolute server-side path to the Images/ directory, resolved at runtime via getServletContext().getRealPath("/Images/"). It is injected into the JasperReports template as a parameter so the TEI logo image can be embedded in the PDF header. On some servers getRealPath may return null (e.g. when the WAR is not exploded); in that case the servlet falls back to the relative Constantes.DOMINIO_IMAGENES constant.