Skip to content

letui/UnityExcel

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 

Repository files navigation

UnityExcel

操纵Excel的好工具,支持集合类型直接导出excel。

用例

List temp=new ArrayList();
temp.add(new DemoObject("宋丹丹",32,33.500,new Date()));
temp.add(new DemoObject("赵本山",36,23.5,new Date()));
Unity u=new Unity97();
try {
  u.exportUTable(temp, new FileOutputStream("src/temp.xls")).close();
} catch (IOException e) {
  e.printStackTrace();
}

POJO

class DemoObject {
	@UColumn(Head="姓名",Index=1)
	private String name;
	@UColumn(Head="年龄",Index=2)
	@UMapper(JsonMap="{'1':'一','2':'二'}")
	private int age;
	@UColumn(Head="腰围",Index=3,Suffix="寸",Prefix="SN-")
	@UFormatter(FormatPartten="##.##")
	private double width;
	@UColumn(Index=4)
	@UFormatter(FormatPartten="yyyy-MM-dd")
	@UStyleBinder()
	private Date birthday;
 }
看懂或者看不懂,代码就在这里,谢谢。

About

易用易扩展的Excel导出导入工具包

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages