Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public void GerarRelatorio(String matricula,String nome,String cpf,String email) {
- //parametros ! extremamente necessario
- try{
- Map parametro = new HashMap();
- parametro.put("matricula", matricula);
- parametro.put("nome", nome);
- parametro.put("cpf", cpf);
- parametro.put("email", email);
- JasperPrint print = JasperFillManager.fillReport("arquivo compilado", parametro,chama sua conexao);
- JasperViewer viwer = new JasperViewer(print, false);// deixa false pq se vc fechar o relatorio ele não fechará seu programa
- viwer.setVisible(true);
- }
- catch(Exception ex){
- System.out.println("Problemas com o relatório !");
- }
- }
- //quando for chamar o relatorio em um button
- GerarRelatorio("matricula","nome", "cpf", "email");
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement