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; }
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); }
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; }