org.jiucai.appframework.base.util
类 CsvDownloadUtil

java.lang.Object
  继承者 org.jiucai.appframework.common.util.BaseUtil
      继承者 org.jiucai.appframework.base.util.CsvDownloadUtil

public class CsvDownloadUtil
extends BaseUtil

CSV 下载工具

作者:
zhaidw

字段摘要
protected static String cellPrefix
          为单元格数据增加后缀,用来支持 Excel 中正确显示格式
protected static String cellSuffix
          为单元格数据增加后缀,用来支持 Excel 中正确显示格式
protected static String fileCharset
           
protected static Boolean preserveSpaces
          是否保留数据两边的空格
 
从类 org.jiucai.appframework.common.util.BaseUtil 继承的字段
log
 
构造方法摘要
CsvDownloadUtil()
           
 
方法摘要
protected static String getConvertedMapValue(Object val)
           
static String getFileName(String displayName)
          getFileName
static String saveFile(String filePath, String fileName, List<KeyValuePair> headList, List<Map<String,Object>> dataList, List<Map<String,Object>> sumList, Boolean isAppend)
           
static void setCellPrefix(String prefix)
           
static void setCellSuffix(String suffix)
           
static void setCharset(String charset)
           
static void setPreserveSpaces(Boolean allowSpaces)
           
 
从类 org.jiucai.appframework.common.util.BaseUtil 继承的方法
convertMapValue
 
从类 java.lang.Object 继承的方法
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

字段详细信息

fileCharset

protected static String fileCharset

cellPrefix

protected static String cellPrefix
为单元格数据增加后缀,用来支持 Excel 中正确显示格式


cellSuffix

protected static String cellSuffix
为单元格数据增加后缀,用来支持 Excel 中正确显示格式


preserveSpaces

protected static Boolean preserveSpaces
是否保留数据两边的空格

构造方法详细信息

CsvDownloadUtil

public CsvDownloadUtil()
方法详细信息

setCharset

public static void setCharset(String charset)

setCellPrefix

public static void setCellPrefix(String prefix)

setCellSuffix

public static void setCellSuffix(String suffix)

setPreserveSpaces

public static void setPreserveSpaces(Boolean allowSpaces)

saveFile

public static final String saveFile(String filePath,
                                    String fileName,
                                    List<KeyValuePair> headList,
                                    List<Map<String,Object>> dataList,
                                    List<Map<String,Object>> sumList,
                                    Boolean isAppend)
参数:
filePath - 输出文件路径
headList - 表头列表
dataList - 数据列表
sumList - 总计列表
isAppend - 是否文件追加数据
返回:
生成的文件全路径

getFileName

public static String getFileName(String displayName)
getFileName

参数:
displayName -
返回:
String

getConvertedMapValue

protected static String getConvertedMapValue(Object val)


Copyright © 2013. All Rights Reserved.