Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public void imprimeRelatorio() {
- ConexaoMySql co = new ConexaoMySql();
- co.setUrl("jdbc:mysql://localhost:3306/poc");
- co.setUsuario("root");
- co.setSenha("");
- String src = "C:\Users\Administrador\Documents\Eduardo\ControleOrcamento\src\vendas\orcamento.jasper";
- Map<String, Object> parametros = new HashMap<String, Object>();
- parametros.put("id", (Integer.parseInt(inpId.getText())));
- JasperPrint jasperPrint = null;
- try {
- jasperPrint = JasperFillManager.fillReport(src, parametros, co.getConnection());
- } catch (JRException ex) {
- Logger.getLogger(TelaControle.class.getName()).log(Level.SEVERE, null, ex);
- }
- JasperViewer view = new JasperViewer(jasperPrint, false);
- view.setVisible(true);
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement