I create reports with ireport, and when I do a query in it, the report appears immediately, when I executed in java (netbeans), after 3 minutes (yes, 3!) appeared the report. why is it so slow?
public class cExport_thread extends Thread{
private Alumnos alu;
private AccesoDatos con;
/** Creates a new instance of cExport_thread */
public cExport_thread() {
}
public void run(){
con = new AccesoDatos
("developers","lania","com.mysql.jdbc.Driver","192.168.1.8","siau");
con.iniciar();
Connection conn=con.getConnection();
try{
File fdesign = new File
("C:\\SIAU\\Reportes\\reporte1.jasper");
String fileName="C:\\SIAU\\reportes\\reporte1.jasper";
// Ruta de archivo pdf de destino
String destFileNamePdf="C:\\SIAU\\Reportes\\reporte1.pdf";
//Ruta de archivo xls de destino
// String destFileNameXls="C:\\SIAU\\reportes\\reporte1.xls";
Map parameters = new HashMap();
parameters.put("P_alu_carrera", "01");
JasperPrint listo = JasperFillManager.fillReport
(fdesign.getPath(),parameters,conn);
JasperExportManager.exportReportToPdfFile(listo,
destFileNamePdf);
JasperViewer.viewReport(listo);
// JRXlsExporter exporter = new JRXlsExporter();
//exporter.setParameter(JRExporterParameter.JASPER_PRINT,
jasperPrint);
//exporter.setParameter(JRExporterParameter.OUTPUT_FILE_NAME,
destFileNameXls);
//exporter.setParameter
(JRXlsExporterParameter.IS_ONE_PAGE_PER_SHEET, Boolean.TRUE);
//exporter.exportReport();
//System.exit(0);
}
catch (Exception e)
{
System.out.println(e.getMessage());
}
}
If you have the solution, please help me