Office 软件操作组件 common.office

码农软件 · 软件分类 · Excel开发包 · 2019-09-16 13:42:24

软件介绍

java组件,实现Excel,word,pdf等常用office的

#目前只完善Excel的导入导出,方便简洁。具体步骤如下: 1,定义与Excel对应的bean类,加上配置。

@ExcelSheet(sheetIndex=0,titleIndex=1,dataIndex=2)
public class UploadUser {
@ExcelColumn(fieldTitle = "登录名称", columnIndex = 0)

private String username;

@ExcelColumn(fieldTitle = "角色", columnIndex = 1)

//@ColumnDataHandler("io.tsing.admin.util.RoleTranslate")

private String role;

@ExcelColumn(fieldTitle = "昵称", columnIndex = 2)

private String nickname;

@ExcelColumn(fieldTitle = "姓名", columnIndex = 3)

private String realname;

@ExcelColumn(fieldTitle = "性别", columnIndex = 4)

private String gender;

@ExcelColumn(fieldTitle = "密码", columnIndex = 5)

//@ColumnDataHandler("io.tsing.admin.util.PassWordTranslate")

private String password;

@ExcelColumn(fieldTitle = "邮件", columnIndex = 6)

private String email;

@ExcelColumn(fieldTitle = "手机号码", columnIndex = 7)

private String mobile;

@ExcelColumn(fieldTitle = "电话号码", columnIndex = 8)

private String telephone;


get*(){}
set*(*){}
}

2、调用导入导出方法,就可以实现导入导出了。

public void static main(String arg[]) {
ExcelUtil excelUtil = new ExcelUtil();
//导入:
InputStream inputStream=new FileInputStream(String.format("%s%s", path, "persionTempalte.xlsx"));
List s=excelUtil.parse(inputStream, UploadUser.class);
导出: File file = new File(String.format("%s%s", path, "text.xlsx"));
OutputStream os = new FileOutputStream(file);
excelUtil.export(os, list, maps, null);
}

#就只要俩个步骤就可以实现导出导入,而且支持大数据的导出导入,还有可以个性化处理每一列的数据。

本文地址:https://www.codercto.com/soft/d/14723.html

Graph Algorithms

Graph Algorithms

Shimon Even / Cambridge University Press / 2011-9-19 / USD 32.99

Shimon Even's Graph Algorithms, published in 1979, was a seminal introductory book on algorithms read by everyone engaged in the field. This thoroughly revised second edition, with a foreword by Richa......一起来看看 《Graph Algorithms》 这本书的介绍吧!

图片转BASE64编码
图片转BASE64编码

在线图片转Base64编码工具

UNIX 时间戳转换
UNIX 时间戳转换

UNIX 时间戳转换

HSV CMYK 转换工具
HSV CMYK 转换工具

HSV CMYK互换工具