Created
May 9, 2020 19:30
-
-
Save HashRaygoza/f92375fc286af0a3eb22ee661572f89b to your computer and use it in GitHub Desktop.
Agrega datos a una fila de Excel
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 <TipoGenerico> void agregarDatos(Row fila, TipoGenerico dato) throws IllegalAccessException, InvocationTargetException, NoSuchMethodException { | |
| Class clase = dato.getClass(); | |
| Field[] campos = clase.getDeclaredFields(); | |
| int numCelda = 0; | |
| for (Field campo : campos) { | |
| ColumnaReporte columna = campo.getAnnotation(ColumnaReporte.class); | |
| Cell celda = fila.createCell(numCelda); | |
| if (columna != null) { | |
| this.agregarDato(celda, PropertyUtils.getSimpleProperty(dato, campo.getName())); | |
| numCelda++; | |
| } | |
| } | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment