docs: @Override
    public final void write(final Map<String, Object> pReqVars,
      final List<List<Object>> pData, final CsvMethod pCsvMethod,
        final OutputStream pOus) throws Exception {
      Map<Long, MatchForeign> mfMap = new HashMap<Long, MatchForeign>();
      Map<Integer, SimpleDateFormat> dateFormats =
        new HashMap<Integer, SimpleDateFormat>();
      Map<Integer, String[]> numericSeps = new HashMap<Integer, String[]>();
      for (CsvColumn col : pCsvMethod.getColumns()) {
        if (col.getDataFormat() != null) {
          if (col.getItsType().equals(ECsvColumnType.DATE)) {
            try {
              dateFormats.put(col.getItsIndex(),
                new SimpleDateFormat(col.getDataFormat()));
            } catch (Exception ee) {
              throw new ExceptionWithCode(ExceptionWithCode
                .CONFIGURATION_MISTAKE, "Wrong date format! Format: "
                  + col.getDataFormat(), ee);
            }
          } else if (col.getItsType().equals(ECsvColumnType.NUMERIC)) {
            String[] seps = null;
            try {
              seps = col.getDataFormat().split(",");
              for (int i = 0; i < 2; i++) {
                if ("SPACE".equals(seps[i])) {
                  seps[i] = "\u00A0";
                } else if ("COMMA".equals(seps[i])) {
                  seps[i] = ",";
                }
              }
              numericSeps.put(col.getItsIndex(), seps);
            } catch (Exception ee) {
              throw new ExceptionWithCode(ExceptionWithCode.CONFIGURATION_MISTAKE,
                "Wrong amount format! Format: "
                  + col.getDataFormat(), ee);
            }
          }
        }
      }
      Collections.sort(pCsvMethod.getColumns(), new CmprCsvColumn());
      OutputStreamWriter writer = null;
      try {
        writer = new OutputStreamWriter(pOus, Charset
          .forName(pCsvMethod.getCharsetName()).newEncoder());
        if (pCsvMethod.getHasHeader()) {
          for (int i = 0; i < pCsvMethod.getColumns().size(); i++) {
            if (i == 0) {
              writer.write(pCsvMethod.getColumns().get(i).getItsName());
            } else if (i == pCsvMethod.getColumns().size() - 1) {
              writer.write(pCsvMethod.getColumnSep() + pCsvMethod.getColumns()
                .get(i).getItsName() + "\r\n");
            } else {
              writer.write(pCsvMethod.getColumnSep()
               + pCsvMethod.getColumns().get(i).getItsName());
            }
          }
        }
        for (List<Object> row : pData) {
          for (int i = 0; i < pCsvMethod.getColumns().size(); i++) {
            String colVal = ""; //null default
            if (pCsvMethod.getColumns().get(i).getConstValue() != null) {
              colVal = pCsvMethod.getColumns().get(i).getConstValue();
            } else if (pCsvMethod.getColumns().get(i).getDataIndex() != null
          && row.get(pCsvMethod.getColumns().get(i).getDataIndex() - 1) != null) {
              Object objVal = null;
              if (pCsvMethod.getColumns().get(i).getFieldPath() == null) {
                objVal = row.get(pCsvMethod.getColumns().get(i)
                  .getDataIndex() - 1);
              } else {
                String[] fpa = pCsvMethod.getColumns().get(i).getFieldPath()
                  .split(",");
                Object entity = row.get(pCsvMethod.getColumns().get(i)
                  .getDataIndex() - 1);
                for (int j = 0; j < fpa.length; j++) {
                  Method getter = this.utlReflection
                    .retrieveGetterForField(entity.getClass(), fpa[j]);
                  objVal = getter.invoke(entity);
                  entity = objVal;
                  if (entity == null) {
                    break;
                  }
                }
              }
              if (objVal != null) {
                if (pCsvMethod.getColumns().get(i).getDataFormat() == null) {
                  if (pCsvMethod.getColumns().get(i).getMatchForeign() != null) {
                    MatchForeign mf = mfMap.get(pCsvMethod.getColumns()
                      .get(i).getMatchForeign().getItsId());
                    if (mf == null) {
                      mf = this.hldMatchForeign.getFor(pReqVars, pCsvMethod
                        .getColumns().get(i).getMatchForeign().getItsId());
                      if (mf == null) {
                    throw new ExceptionWithCode(ExceptionWithCode.WRONG_PARAMETER,
                  "Can't find match foreign ID "
                + pCsvMethod.getColumns().get(i).getMatchForeign().getItsId());
                      }
                      mfMap.put(pCsvMethod.getColumns().get(i).getMatchForeign()
                        .getItsId(), mf);
                    }
                    String natVal = objVal.toString();
                    for (MatchForeignLine mfl : mf.getItsLines()) {
                      if (natVal.equals(mfl.getNativeVal())) {
                        colVal = mfl.getForeignVal();
                        break;
                      }
                    }
                  } else {
                    colVal = objVal.toString();
                  }
                } else {
                  if (pCsvMethod.getColumns().get(i).getItsType()
                    .equals(ECsvColumnType.DATE)) {
                    colVal = dateFormats.get(pCsvMethod.getColumns().get(i)
                      .getItsIndex()).format((Date) objVal);
                  } else if (pCsvMethod.getColumns().get(i).getItsType()
                    .equals(ECsvColumnType.NUMERIC)) {
                    String[] seps = numericSeps.get(pCsvMethod.getColumns().get(i)
                      .getItsIndex());
                    Integer scale = null;
                    if (seps.length == 3) {
                      scale = Integer.parseInt(seps[2]);
                    }
                    BigDecimal bdv = (BigDecimal) objVal;
                    if (scale == null) {
                      scale = bdv.scale();
                    } else {
                      bdv = bdv.setScale(scale, RoundingMode.HALF_UP);
                    }
                    colVal = this.srvNumberToString.print(objVal.toString(),
                      seps[0], seps[1], scale);
                  } else if (pCsvMethod.getColumns().get(i).getItsType()
                    .equals(ECsvColumnType.BOOLEAN)) {
                    String[] frm = pCsvMethod.getColumns().get(i)
                      .getDataFormat().split(",");
                    Boolean blv = (Boolean) objVal;
                    if (blv) {
                      colVal = frm[0];
                    } else {
                      colVal = frm[1];
                    }
                  } else {
                    throw new ExceptionWithCode(ExceptionWithCode
                      .CONFIGURATION_MISTAKE, "data_format_not_yet_implemented");
                  }
                }
              }
            }
            if (pCsvMethod.getColumns().get(i).getTextDelimiter() != null
              && !"".equals(colVal)) {
              colVal = pCsvMethod.getColumns().get(i).getTextDelimiter()
                + colVal + pCsvMethod.getColumns().get(i).getTextDelimiter();
            }
            if (i == 0) {
              writer.write(colVal);
            } else if (i == pCsvMethod.getColumns().size() - 1) {
              writer.write(pCsvMethod.getColumnSep() + colVal + "\r\n");
            } else {
              writer.write(pCsvMethod.getColumnSep() + colVal);
            }
          }
        }
      } finally {
        if (writer != null) {
          writer.close();
        }
      }
    }