1
Within the Netbeans IDE the code works and the report is presented.
But when generating the executable, it is not possible to open the report, receiving the null message.
It’s like he can’t trace the report.
public ClienteREL() {
this.path = this.getClass().getClassLoader().getResource("").getPath();
this.pathToReportPackage = this.path + "br/com/prologica/report/";
System.out.println(this.pathToReportPackage);
}
//Imprime/gera uma lista de Clientes
public void imprimir(List<Cliente> clientes) throws Exception
{
JasperReport report = JasperCompileManager.compileReport(this.getPathToReportPackage() + "imprimir.jrxml");
JasperPrint print = JasperFillManager.fillReport(report, null, new JRBeanCollectionDataSource(clientes));
JasperPrintManager jasperPrintManager = null;
jasperPrintManager.printReport(print, false);
}
Are you generating a jar? If so, try running it straight from the prompt and see if any errors are popping.
– user28595
'cause buddy, running on the console is like he can’t find the report.
– Marcio Fermino
Running the jar on the console displays nothing either?
– user28595
nothing... but inside go right
– Marcio Fermino