maxiaoding / excel-plus

❇️ Improve the productivity of the Excel operation library. https://git.io/vNjQy

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

excel-plus

Easier to read and generate an excel file, supports 2003 and 2007.

@biezhi on zhihu

中文文档

Feature

  • Easy to use
  • Annotation driven
  • Based java 8
  • Support xlsxlsxcsv
  • Support export by template
  • Support custom column style

Usage

As maven dependency

<dependency>
    <groupId>io.github.biezhi</groupId>
    <artifactId>excel-plus</artifactId>
    <version>0.1.2-RELEASE</version>
</dependency>

snapshot version

<dependency>
    <groupId>io.github.biezhi</groupId>
    <artifactId>excel-plus</artifactId>
    <version>0.1.3-SNAPSHOT</version>
</dependency>

Export as file

ExcelPlus excelPlus = new ExcelPlus();
List<Order> orders = queryData();
excelPlus.exportor(orders).writeAsFile(new File("order-list.xls"));

Browser download

ExcelPlus excelPlus = new ExcelPlus();
List<Order> orders = queryData();

excelPlus.exportor(orders)
         .writeAsResponse(ResponseWrapper.create(HttpServletResponse, "order-list.xls"));

Read as file

ExcelPlus excelPlus = new ExcelPlus();

Reader reader = Reader.create()
                .parseType(ParseType.SAX)
                .startRowIndex(2)
                .sheetIndex(0)
                .excelFile(new File("orders.xlsx"));

List<Order> orders = excelPlus.read(Order.class, reader).asList();

Examples

See here

Advanced

Custom export style

License

Apache2

About

❇️ Improve the productivity of the Excel operation library. https://git.io/vNjQy

License:Apache License 2.0


Languages

Language:Java 100.0%