Two filters working in a JAVA report

Asked

Viewed 123 times

0

Staff I’m doing a job for the college I got on the report part and I created the report as the image shows

inserir a descrição da imagem aqui

However I could only make the name field work in a second java class I created using the following code

public class rela_clientes_nome {
    conexaoBD conn = new conexaoBD();

    public void rela_clientes(String nome) {

        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);
        }
    }
}

Good that way I called on the button print the report created with IREPORT and this puchando only by the NAME FILTER as shows the code:

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());
}     

Good would like to know how to fix the two filters NAME and CPF working together?

No answers

Browser other questions tagged

You are not signed in. Login or sign up in order to post.