示例#1
0
  public static String exportCSV(List<Object[]> data, List<String> cnFields) {
    String basePath = getExportPath();
    String exportFileName = System.currentTimeMillis() + ".csv";
    String exportPath = basePath + "/" + exportFileName;

    DataExport.exportCSV(exportPath, convertList2Array(data), cnFields);
    return exportFileName;
  }
示例#2
0
  public static void exportCSV(String path, Object[][] data, List<String> fields) {
    List<Object[]> list = new ArrayList<Object[]>();
    for (Object[] temp : data) {
      list.add(temp);
    }

    DataExport.exportCSV(path, list, fields);
  }
示例#3
0
  public static String exportCSV(
      String fileName, List<Map<String, Object>> data, List<String> fields) {
    List<Object[]> list = new ArrayList<Object[]>();
    for (Map<String, Object> row : data) {
      list.add(row.values().toArray());
    }

    String exportPath = DataExport.getExportPath() + "/" + fileName;
    exportCSV(exportPath, list, fields);

    return exportPath;
  }