I am generating a Pdf report using Jasper Reports plugin in Eclipse. While working on the project in Eclipse the PDF creation time is approximately 5 seconds. When I export the project into an executable Jar file with the libraries packaged in the Jar the PDF creation time goes up to almost 3-4 minutes. Any ideas why that happens? Thanks in advance. If any other details should be provided please let me know. (Query returns 70 rows)
try{
Connection connection=null;
connection=dbConnect.dbConnector();
String year comboBox_1.getSelectedItem().toString();
String items = textField_1.getText().toString();
String amount = textField_2.getText().toString();
Map parametersMap = new HashMap();
parametersMap.put("year",year);
parametersMap.put("items",items);
parametersMap.put("amount",amount);
String reportPath = "C:\\Users\\Panagiotis\\workspace\\OceanBlue\\SalesReportYear.jrxml";
JasperReport jr = JasperCompileManager.compileReport(reportPath);
JasperPrint jp = JasperFillManager.fillReport(jr,parametersMap,connection);
JasperExportManager.exportReportToPdfFile(jp, "C:\\Users\\Panagiotis\\Desktop\\SaleReport"+textField_3.getText()+".pdf");
connection.close();
}
catch(Exception ex){
System.out.println(ex.getMessage());
}
}