Skip to content

Instantly share code, notes, and snippets.

@HashRaygoza
Created May 9, 2020 19:28
Show Gist options
  • Select an option

  • Save HashRaygoza/ad3db5e7f7f144d03162689e85919a8d to your computer and use it in GitHub Desktop.

Select an option

Save HashRaygoza/ad3db5e7f7f144d03162689e85919a8d to your computer and use it in GitHub Desktop.
Crea el encabezado del reporte en base a las anotaciones
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