I'm doing a job for college, I got the report part and created the report as the image shows.
HoweverIwasabletojustmakethenamefieldworkonasecondjavaclassthatIcreatedusingthefollowingcode
publicclassrela_clientes_nome{conexaoBDconn=newconexaoBD();publicvoidrela_clientes(Stringnome){try{conn.conexao();conn.executaSql("select * from clientes where nome like '%"+nome+"%'");
JRResultSetDataSource relatResul = new JRResultSetDataSource(conn.rs);
JasperPrint jpPrint = JasperFillManager.fillReport("src/rela_ireport/clientes.jasper", new HashMap(), relatResul);
JasperViewer jv = new JasperViewer(jpPrint, false);
jv.setVisible(true);
jv.toFront();
} catch (JRException ex) {
Logger.getLogger(rela_clientes_nome.class.getName()).log(Level.SEVERE, null, ex);
}
}
}
Well this way I called the button print the report created with IREPORT and it is only warming up by FILTER NAME as the code shows:
private void jButtonImprimirActionPerformed(java.awt.event.ActionEvent evt) {
// TODO add your handling code here:
rela_clientes relatorio = new rela_clientes();
relatorio.rela_clientes(jTextFieldNome.getText());
}
Well, how would you sort out the two NAME and CPF filters working together?