Boa Tarde a Tds,
Estou gerando um relatorio de clientes, estou tentando fazer ele gerar um arquivo em pdf e gravar esse pdf na area de trabalho.
public JasperPrint gerar() throws ExcDados{
JasperPrint rel=null;
String arquivoNovo = "clientes.pdf";
try{
HashMap map= new HashMap();
String arquivoJasper="clientes.jasper";
rel=JasperFillManager.fillReport(arquivoJasper,map,conex);
JRExporter exporter = new JRPdfExporter();
exporter.setParameter(JRExporterParameter.OUTPUT_FILE_NAME,arquivoNovo);
exporter.setParameter(JRExporterParameter.JASPER_PRINT, rel);
exporter.exportReport();
}
catch(JRException e){
JOptionPane.showMessageDialog(null,e.getMessage());
}
return rel;
}
Vlw a Tds.