MyExcel 2.3.2 release, Bug fix & performance improvements

  

MyExcel is a set of import, export, encryption, Excel and many other features of Java toolkit.

Import : Provides simple API, read the contents of Excel, and converted to List <Bean>.

Export : fast mass data derived a simple list, the layout may be generated high complexity of Excel, a complex comprising a plurality of layout refers irregular merged cells, background color, font size, italics and so on.

advantage:

  • Complex may be generated in any form : This tool uses an iterative manner excel rendering cells, may be generated excel arbitrary complexity, adaptive width, height;
  • Zero learning costs : use as a template html, learning cost is almost zero;
  • Support for common background color, borders, fonts, and other style settings : see in particular document -Style-support (style support) section;
  • Support for .XLS, .XLSX : support for generating .xls, .xlsx suffix excel;
  • Support formula is derived : support setting a formula in Excel template, reducing the amount of computation server-side;
  • SXSSF low memory mode supports : low-memory support SXSSF mode may be utilized to generate low memory .xlsx;
  • Support for producer-consumer model export : Support for producer-consumer model exported without a one-time all the data, batch data acquisition mode with SXSSF real significance Shanghai amount of data export;
  • Support a variety of template engine : is built Freemarker, Groovy, Beetl other commonly used Excel template engine builder (For details, see documents the Getting Started ), recommended Beetl template engine ( Beetl document );
  • Excel provides a default constructor, direct output simple Excel : without writing html, the default template is built, can be output directly from the POJO data list;
  • Generate support for a multi-sheet : to table a sheet unit, to support a multi-sheet document excel export;

The updates are as follows:

  1. Default template builder (e.g. FreemarkerExcelBuilder) template engine of a single embodiment, each constructed to avoid repetition create engine performance;
  2. Construction of rendering optimization template to replace the file memory render rendered rendering template to enhance performance; (thanks @monocc)
  3. Under repair some situations that may arise export excel prompt "Because some of the content can not be read, Excel .xlsx order information can not be opened if you want to open and fix this workbook.?" Questions;
  4. Optimize reading conversion logic, further abstraction;

We recommend that all users upgrade to use the specific use, venue: https://github.com/liaochong/myexcel/wik

// 全部读取后处理
List<ArtCrowd> result = DefaultExcelReader.of(ArtCrowd.class)
        .sheet(0) // 如果为0,可省略该操作
        .rowFilter(row -> row.getRowNum() > 0) // 如无需过滤,可省略该操作
        .read(path.toFile());


// 读取一行处理一行,可自行决定终止条件
DefaultExcelReader.of(ArtCrowd.class)
        .sheet(0) // 如果为0,可省略该操作
        .rowFilter(row -> row.getRowNum() > 0) // 如无需过滤,可省略该操作
        .readThen(path.toFile() ,artCrowd -> System.out.println(artCrowd.getName));


public class ArtCrowd {
    // index代表列索引,从0开始
    @ExcelColumn(index = 0)
    private String name;

    @ExcelColumn(index = 1)
    private String age;

    @ExcelColumn(index = 2,dateFormatPattern="yyyy-MM-dd")
    private Date birthday;
}

Guess you like

Origin www.oschina.net/news/107033/myexcel-2-3-2-released