private void jBPagamentosANActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jBPagamentosANActionPerformed
        Relatorios.this.dispose();
        if (jDateRA.getDate() != null) {
            try {
                Connection con = new Conexao().getConnection();
                HashMap parametros = new HashMap();
                String formatador = new SimpleDateFormat("dd/MM/yyyy").format(jDateRA.getDate());
                parametros.put("VALOR", formatador);


                JasperPrint jp = JasperFillManager.fillReport("./relatorios/PagamentosPendentes.jasper", parametros, con);
                if (jRBSalvar.isSelected()) {
                    JasperExportManager.exportReportToPdfFile(jp, "C:/Contas a receber Contratos - Seeds.pdf");
                }
                JasperViewer jrv = new JasperViewer(jp, false);
                jrv.setVisible(true);
                con.close();
            } catch (Exception e) {
                e.printStackTrace();
            }
            try {
                Connection con = new Conexao().getConnection();
                HashMap parametros = new HashMap();
                String formatador = new SimpleDateFormat("dd/MM/yyyy").format(jDateRA.getDate());
                parametros.put("VALOR", formatador);


                JasperPrint jp = JasperFillManager.fillReport("./relatorios/PagamentosPendentes1.jasper", parametros, con);
                if (jRBSalvar.isSelected()) {
                    JasperExportManager.exportReportToPdfFile(jp, "C:/Contas a receber Contratos Pendentes- Seeds.pdf");
                }
                JasperViewer jrv = new JasperViewer(jp, false);
                jrv.setVisible(true);
                con.close();
            } catch (Exception e) {
                e.printStackTrace();
            }
        } else {
            if (jDateRN.getDate() != null) {
                try {
                    Connection con = new Conexao().getConnection();
                    HashMap parametros = new HashMap();
                    String formatador = new SimpleDateFormat("yyyy/MM/dd").format(jDateRN.getDate());
                    parametros.put("VALOR", formatador);


                    JasperPrint jp = JasperFillManager.fillReport("./relatorios/PagamentosPendentes.jasper", parametros, con);
                    if (jRBSalvar.isSelected()) {
                        JasperExportManager.exportReportToPdfFile(jp, "C:/Contas a receber Contratos - Seeds.pdf");
                    }
                    JasperViewer jrv = new JasperViewer(jp, false);
                    jrv.setVisible(true);
                    con.close();
                } catch (Exception e) {
                    e.printStackTrace();
                }
                try {
                    Connection con = new Conexao().getConnection();
                    HashMap parametros = new HashMap();
                    String formatador = new SimpleDateFormat("yyyy/MM/dd").format(jDateRN.getDate());
                    parametros.put("VALOR", formatador);


                    JasperPrint jp = JasperFillManager.fillReport("./relatorios/PagamentosPendentes1.jasper", parametros, con);
                    if (jRBSalvar.isSelected()) {
                        JasperExportManager.exportReportToPdfFile(jp, "C:/Contas a receber Contratos Pendentes- Seeds.pdf");
                    }
                    JasperViewer jrv = new JasperViewer(jp, false);
                    jrv.setVisible(true);
                    con.close();
                } catch (Exception e) {
                    e.printStackTrace();
                }
            } else {
                try {

                    ContasRDAO dao = new ContasRDAO();

                    //--------///------///----ContasReceberContratos conta = new ContasReceberContratos(null);
                    selection = JOptionPane.showConfirmDialog(this,
                            "Deseja carregar todos os dados?\n"
                            + "Consta na base de dados: \n" + dao.gerarCodigoContaR() + ""
                            + " registros.",
                            "", JOptionPane.OK_CANCEL_OPTION,
                            JOptionPane.WARNING_MESSAGE);
                    dao.desconectar();
                } catch (Exception ex) {
                    Logger.getLogger(Relatorios.class.getName()).log(Level.SEVERE, null, ex);
                }
                if (selection == JOptionPane.OK_OPTION) {
                    try {
                        Connection con = new Conexao().getConnection();
                        HashMap parametros = new HashMap();


                        JasperPrint jp = JasperFillManager.fillReport("./relatorios/PagamentosPendentes2.jasper", parametros, con);
                        if (jRBSalvar.isSelected()) {
                            JasperExportManager.exportReportToPdfFile(jp, "C:/Contas a receber Contratos - Seeds.pdf");
                        }
                        JasperViewer jrv = new JasperViewer(jp, false);
                        jrv.setVisible(true);
                        con.close();
                    } catch (Exception e) {
                        e.printStackTrace();
                    }
                    try {
                        Connection con = new Conexao().getConnection();
                        HashMap parametros = new HashMap();


                        JasperPrint jp = JasperFillManager.fillReport("./relatorios/PagamentosPendentes21.jasper", parametros, con);
                        if (jRBSalvar.isSelected()) {
                            JasperExportManager.exportReportToPdfFile(jp, "C:/Contas a receber Contratos Pendentes- Seeds.pdf");
                        }
                        JasperViewer jrv = new JasperViewer(jp, false);
                        jrv.setVisible(true);
                        con.close();
                    } catch (Exception e) {
                        e.printStackTrace();
                    }
                } else {
                    new Relatorios(null, rootPaneCheckingEnabled).setVisible(true);
                }
            }
        }
    }