private void jButton3ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButton3ActionPerformed
        setCursor(Cursor.getPredefinedCursor(Cursor.WAIT_CURSOR));
        DateFormat df = new SimpleDateFormat("dd/MM/yyyy");
        if (cariText.getText().equalsIgnoreCase("") || cariText.getText() == null) {
            JOptionPane.showMessageDialog(null, "Kotak pencarian belum di isi!");
        } else {
            if (kolomCombo.getSelectedItem().equals("NIK")) {
                cariQuery = entityManager.createQuery("SELECT r FROM Report r WHERE r.nik=:nik AND r.unit=:unit AND r.subunit=:subunit AND r.tgl>=:datefrom AND r.tgl<=:dateto");
                cariQuery.setParameter("nik", cariText.getText());
                cariQuery.setParameter("unit", unit);
                cariQuery.setParameter("subunit", subunit);
                cariQuery.setParameter("datefrom", dateFrom);
                cariQuery.setParameter("dateto", dateTo);
            }
            if (kolomCombo.getSelectedItem().equals("NAMA")) {
                cariQuery = entityManager.createQuery("SELECT r FROM Report r WHERE r.nama=:nama AND r.unit=:unit AND r.subunit=:subunit AND r.tgl>=:datefrom AND r.tgl<=:dateto");
                cariQuery.setParameter("nama", cariText.getText());
                cariQuery.setParameter("unit", unit);
                cariQuery.setParameter("subunit", subunit);
                cariQuery.setParameter("datefrom", dateFrom);
                cariQuery.setParameter("dateto", dateTo);
            }
            if (kolomCombo.getSelectedItem().equals("REGU")) {
                cariQuery = entityManager.createQuery("SELECT r FROM Report r WHERE r.regu=:regu AND r.unit=:unit AND r.subunit=:subunit AND r.tgl>=:datefrom AND r.tgl<=:dateto");
                cariQuery.setParameter("regu", cariText.getText());
                cariQuery.setParameter("unit", unit);
                cariQuery.setParameter("subunit", subunit);
                cariQuery.setParameter("datefrom", dateFrom);
                cariQuery.setParameter("dateto", dateTo);
            }
            if (kolomCombo.getSelectedItem().equals("TANGGAL")) {
                try {
                    cariQuery = entityManager.createQuery("SELECT r FROM Report r WHERE r.tgl=:tgl AND r.unit=:unit AND r.subunit=:subunit AND r.tgl>=:datefrom AND r.tgl<=:dateto");
                    cariQuery.setParameter("tgl", df.parse(cariText.getText()));
                    cariQuery.setParameter("unit", unit);
                    cariQuery.setParameter("subunit", subunit);
                    cariQuery.setParameter("datefrom", dateFrom);
                    cariQuery.setParameter("dateto", dateTo);
                } catch (ParseException ex) {
                    Logger.getLogger(ReportForm.class.getName()).log(Level.SEVERE, null, ex);
                }
            }
            if (kolomCombo.getSelectedItem().equals("LOKASI")) {
                cariQuery = entityManager.createQuery("SELECT r FROM Report r WHERE r.lokasi=:lokasi AND r.unit=:unit AND r.subunit=:subunit AND r.tgl>=:datefrom AND r.tgl<=:dateto");
                cariQuery.setParameter("lokasi", cariText.getText());
                cariQuery.setParameter("unit", unit);
                cariQuery.setParameter("subunit", subunit);
                cariQuery.setParameter("datefrom", dateFrom);
                cariQuery.setParameter("dateto", dateTo);
            }
            list.clear();
            list.addAll(cariQuery.getResultList());
            masterTable.updateUI();
            setCursor(Cursor.getPredefinedCursor(Cursor.DEFAULT_CURSOR));
        }
    }//GEN-LAST:event_jButton3ActionPerformed