use of com.alibaba.excel.converters.localdatetime.LocalDateTimeDateConverter in project citrus by Yiuman.
the class WebUtils method exportExcel.
/**
* 动态列导出Excel
*
* @param response 响应
* @param headers 表头
* @param data 数据
* @param name 文件 名
* @throws IOException IO异常
*/
public static void exportExcel(HttpServletResponse response, List<List<String>> headers, List<List<Object>> data, String name) throws IOException {
addExportFilenameHeaders(response, name + ".xls");
response.setContentType(APPLICATION_VND_MS_EXCEL);
EasyExcel.write(response.getOutputStream()).registerConverter(new LocalDateTimeDateConverter()).head(headers).registerWriteHandler(new LongestMatchColumnWidthStyleStrategy()).sheet("sheet1").doWrite(data);
}
use of com.alibaba.excel.converters.localdatetime.LocalDateTimeDateConverter in project easyexcel by alibaba.
the class DefaultConverterLoader method initDefaultWriteConverter.
private static void initDefaultWriteConverter() {
defaultWriteConverter = MapUtils.newHashMapWithExpectedSize(40);
putWriteConverter(new BigDecimalNumberConverter());
putWriteConverter(new BigIntegerNumberConverter());
putWriteConverter(new BooleanBooleanConverter());
putWriteConverter(new ByteNumberConverter());
putWriteConverter(new DateDateConverter());
putWriteConverter(new LocalDateTimeDateConverter());
putWriteConverter(new DoubleNumberConverter());
putWriteConverter(new FloatNumberConverter());
putWriteConverter(new IntegerNumberConverter());
putWriteConverter(new LongNumberConverter());
putWriteConverter(new ShortNumberConverter());
putWriteConverter(new StringStringConverter());
putWriteConverter(new FileImageConverter());
putWriteConverter(new InputStreamImageConverter());
putWriteConverter(new ByteArrayImageConverter());
putWriteConverter(new BoxingByteArrayImageConverter());
putWriteConverter(new UrlImageConverter());
// In some cases, it must be converted to string
putWriteStringConverter(new BigDecimalStringConverter());
putWriteStringConverter(new BigIntegerStringConverter());
putWriteStringConverter(new BooleanStringConverter());
putWriteStringConverter(new ByteStringConverter());
putWriteStringConverter(new DateStringConverter());
putWriteStringConverter(new LocalDateTimeStringConverter());
putWriteStringConverter(new DoubleStringConverter());
putWriteStringConverter(new FloatStringConverter());
putWriteStringConverter(new IntegerStringConverter());
putWriteStringConverter(new LongStringConverter());
putWriteStringConverter(new ShortStringConverter());
putWriteStringConverter(new StringStringConverter());
putWriteStringConverter(new BigIntegerStringConverter());
}
Aggregations