alibaba/easyexcel

Name: easyexcel

Owner: Alibaba

Description: ???????OOM?java??Excel??

Created: 2018-02-06 03:14:08.0

Updated: 2018-05-24 16:33:19.0

Pushed: 2018-05-08 04:00:46.0

Homepage: null

Size: 4588

Language: Java

GitHub Committers

UserMost Recent Commit# Commits

Other Committers

UserEmailMost Recent Commit# Commits

README

JAVA??Excel??easyexcel

Java?????Excel????????Apache poi?jxl???????????????????????poi???SAX???API????????????????????POI??????????07?Excel?????????????????????????????easyexcel???poi?07?Excel??????????3M?excel?POI sax????100M???????KB????????excel?????????03???POI?sax??????????????????????????

????

???

endency>
<groupId>com.alibaba</groupId>
<artifactId>easyexcel</artifactId>
<version>{latestVersion}</version>
pendency>

????

VERSION : 1.0.1

???

???????

????

?Excel
ic void noModelMultipleSheet() {
    InputStream inputStream = getInputStream("2007NoModelMultipleSheet.xlsx");
    try {
        ExcelReader reader = new ExcelReader(inputStream, ExcelTypeEnum.XLSX, null,
            new AnalysisEventListener<List<String>>() {
                @Override
                public void invoke(List<String> object, AnalysisContext context) {
                    System.out.println(
                        "??sheet:" + context.getCurrentSheet().getSheetNo() + " ????" + context.getCurrentRowNum()
                            + " data:" + object);
                }
                @Override
                public void doAfterAllAnalysed(AnalysisContext context) {

                }
            });

        reader.read();
    } catch (Exception e) {
        e.printStackTrace();

    } finally {
        try {
            inputStream.close();
        } catch (IOException e) {
            e.printStackTrace();
        }
    }
}
?Excel
t
ic void test1() throws FileNotFoundException {
    OutputStream out = new FileOutputStream("/Users/jipengfei/78.xlsx");
    try {
        ExcelWriter writer = new ExcelWriter(out, ExcelTypeEnum.XLSX);
        //????sheet, sheet1  ????List<String> ???????
        Sheet sheet1 = new Sheet(1, 0,ExcelPropertyIndexModel.class);
        writer.write(getData(), sheet1);
        writer.finish();
    } catch (Exception e) {
        e.printStackTrace();
    } finally {
        try {
            out.close();
        } catch (IOException e) {
            e.printStackTrace();
        }
    }
}

web??????

package com.alibaba.china.pte.web.seller.dingtalk.rpc;

import java.io.IOException; import java.text.SimpleDateFormat; import java.util.ArrayList; import java.util.Date; import java.util.List;

import javax.servlet.ServletOutputStream; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse;

import com.alibaba.excel.ExcelWriter; import com.alibaba.excel.metadata.Sheet; import com.alibaba.excel.support.ExcelTypeEnum;

import org.springframework.web.bind.annotation.GetMapping; import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RestController;

/**

}

????

??????????????????????????git?????????????????????

??

??????????–??JAVA????????????????????????????jipengfei.jpf@alibaba-inc.com ??????? img


This work is supported by the National Institutes of Health's National Center for Advancing Translational Sciences, Grant Number U24TR002306. This work is solely the responsibility of the creators and does not necessarily represent the official views of the National Institutes of Health.