Created
May 9, 2020 19:28
-
-
Save HashRaygoza/ad3db5e7f7f144d03162689e85919a8d to your computer and use it in GitHub Desktop.
Crea el encabezado del reporte en base a las anotaciones
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| protected void crearEncabezado(Row fila, Class claseDatos) { | |
| Field[] campos = claseDatos.getDeclaredFields(); | |
| int numCelda = 0; | |
| for (Field campo : campos) { | |
| ColumnaReporte columna = campo.getAnnotation(ColumnaReporte.class); | |
| if (columna != null) { | |
| Cell celda = fila.createCell(numCelda); | |
| celda.setCellValue(columna.nombreColumna()); | |
| numCelda++; | |
| } | |
| } | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment