Skip to content

Instantly share code, notes, and snippets.

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

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

Select an option

Save HashRaygoza/90b8274610e7e54cf47754190c727a81 to your computer and use it in GitHub Desktop.
Clase principal del generador de reportes
package mx.ticom.autoreporte;
import java.io.File;
import java.io.IOException;
import java.lang.reflect.InvocationTargetException;
import java.text.ParseException;
import java.util.ArrayList;
import java.util.logging.Level;
import java.util.logging.Logger;
import mx.ticom.autoreporte.dao.EmpleadosDAO;
import mx.ticom.autoreporte.dao.FuenteDatosDAO;
import mx.ticom.autoreporte.reporte.Reporte;
import mx.ticom.autoreporte.vo.DatosReporteEmpleados;
import mx.ticom.autoreporte.vo.DatosReporteProductos;
public class App {
static public void main(String[] args) {
try {
FuenteDatosDAO fuenteDatosDAO = new FuenteDatosDAO();
EmpleadosDAO empleadosDAO = new EmpleadosDAO();
ArrayList<DatosReporteProductos> datos = fuenteDatosDAO.generarDatos();
ArrayList<DatosReporteEmpleados> empleados = empleadosDAO.datosEmpleados();
Reporte reporte = new Reporte();
reporte.crearPaginaReporte(datos, DatosReporteProductos.class, "Reporte de Productos");
reporte.crearPaginaReporte(empleados, DatosReporteEmpleados.class, "Reporte Empleados");
reporte.grabarReporte(new File("reporte.xlsx"));
} catch (ParseException | IllegalAccessException | NoSuchMethodException | InvocationTargetException | IOException ex) {
Logger.getLogger(App.class.getName()).log(Level.SEVERE, null, ex);
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment