public void getEPFformPrintWriter(PaySlipModel psm, String filePath) {
    PaySlip_Earn_Deduction_Model model = new PaySlip_Earn_Deduction_Model();
    try {
      PrintWriter pw = null;
      File file = new File(filePath);
      try {
        pw = new PrintWriter(new BufferedWriter(new FileWriter(file, true)));
      } catch (IOException ex) {
        ex.printStackTrace();
      }

      //            System.out.println("psm.getSupplementarytype() =" + psm.getSupplementarytype());
      //                pw.printf("%-3s%-3s%s%-2s%-10s%6s%5s%5s%5s%5s%4s%5s%5s%5s%2s%s%2s",
      // psm.getBranch(), psm.getPayslipmonth(), "\"", psm.getPayslipyear().substring(2, 4),
      // psm.getPfno(), psm.getSalary(), psm.getEpf(), "0", psm.getEpfloan(), psm.getVpf(), "0",
      // psm.getPercentage367(), psm.getPercentage833(), "0", psm.getEmployeetype(),
      // psm.getSalarytype(), (psm.getSupplementarytype() != null) ? psm.getSupplementarytype() :
      // "");
      pw.printf(
          "%-30s",
          psm.getBranch()
              + ","
              + psm.getPayslipmonth()
              + "\""
              + psm.getPayslipyear().substring(2, 4)
              + ","
              + psm.getPfno()
              + ","
              + psm.getSalary()
              + ","
              + psm.getEpf()
              + ",0,"
              + psm.getEpfloan()
              + ","
              + psm.getVpf()
              + ","
              + psm.getDavpf()
              + ","
              + psm.getPercentage367()
              + ","
              + psm.getPercentage833()
              + ",0,"
              + psm.getEmployeetype()
              + ","
              + psm.getSalarytype()
              + ","
              + psm.getSupplementarytype());
      pw.println();
      pw.flush();
      pw.close();

    } catch (Exception ex) {
      ex.printStackTrace();
    }
  }
  public void getEmployeePrintWriter(
      List<PaySlipModel> emplist, String filePath, String reportType) {
    PaySlip_Earn_Deduction_Model model = new PaySlip_Earn_Deduction_Model();
    try {
      PrintWriter pw = null;
      File file = new File(filePath);
      try {
        pw = new PrintWriter(new BufferedWriter(new FileWriter(file, true)));
      } catch (IOException ex) {
        ex.printStackTrace();
      }

      PaySlipModel psm = null;
      Iterator itr = emplist.iterator();
      if ("DBF".equalsIgnoreCase(reportType)) {
        while (itr.hasNext()) {
          psm = (PaySlipModel) itr.next();
          pw.printf(
              "%-7s%-3s%-3s%-35s%-4s%-10s%-14s",
              psm.getEmpno(),
              psm.getRegion(),
              psm.getSectioncode(),
              psm.getEmployeename(),
              psm.getDesignation(),
              psm.getEpf(),
              psm.getBankaccountno());
          pw.println();
        }
      } else {
        while (itr.hasNext()) {
          psm = (PaySlipModel) itr.next();
          pw.printf(
              "%-37s",
              psm.getRegion()
                  + ","
                  + psm.getEpf()
                  + ","
                  + psm.getEmployeename()
                  + ","
                  + psm.getDesignation()
                  + ","
                  + psm.getSectionname()
                  + ","
                  + psm.getBankaccountno()
                  + ","
                  + psm.getPaymentmode()
                  + ","
                  + psm.getPayscale());
          pw.println();
        }
      }

      pw.flush();
      pw.close();
    } catch (Exception ex) {
      ex.printStackTrace();
    }
  }