tobetwo.excel

Excel Import/Export

License

License

GroupId

GroupId

io.github.tobetwo
ArtifactId

ArtifactId

tobetwo.excel
Last Version

Last Version

1.0.1
Release Date

Release Date

Type

Type

jar
Description

Description

tobetwo.excel
Excel Import/Export
Project URL

Project URL

http://maven.apache.org
Source Code Management

Source Code Management

https://github.com/tobetwo/excel.git

Download tobetwo.excel

How to add to project

<!-- https://jarcasting.com/artifacts/io.github.tobetwo/tobetwo.excel/ -->
<dependency>
    <groupId>io.github.tobetwo</groupId>
    <artifactId>tobetwo.excel</artifactId>
    <version>1.0.1</version>
</dependency>
// https://jarcasting.com/artifacts/io.github.tobetwo/tobetwo.excel/
implementation 'io.github.tobetwo:tobetwo.excel:1.0.1'
// https://jarcasting.com/artifacts/io.github.tobetwo/tobetwo.excel/
implementation ("io.github.tobetwo:tobetwo.excel:1.0.1")
'io.github.tobetwo:tobetwo.excel:jar:1.0.1'
<dependency org="io.github.tobetwo" name="tobetwo.excel" rev="1.0.1">
  <artifact name="tobetwo.excel" type="jar" />
</dependency>
@Grapes(
@Grab(group='io.github.tobetwo', module='tobetwo.excel', version='1.0.1')
)
libraryDependencies += "io.github.tobetwo" % "tobetwo.excel" % "1.0.1"
[io.github.tobetwo/tobetwo.excel "1.0.1"]

Dependencies

compile (3)

Group / Artifact Type Version
junit : junit jar 4.12
org.apache.poi : poi-ooxml jar 3.8-beta4
org.apache.poi : poi-scratchpad jar 3.8-beta4

Project Modules

There are no modules declared in this project.

excel

导出excel

添加依赖

<dependency>
    <groupId>io.github.tobetwo</groupId>
    <artifactId>tobetwo.excel</artifactId>
    <version>1.0.1-SNAPSHOT</version>
</dependency>

使用

Excel e = new Excel();
XSheet sheet;

sheet = e.newSheet().name("基本信息");
sheet.getSchema().add("学号").add("姓名");
sheet.newRecord().add("2010000000").add("Foo");
sheet.newRecord().add("2010000001").add("Bar");

sheet = e.newSheet();
sheet.getSchema().add("foo").add("bar");
sheet.newRecord().add("0").add("1");
sheet.newRecord().add("2").add("4");

export(e.getBytes());

导入excel

byte[] bytes = import2Bytes();
Excel excel = Excel.fromBytes(bytes);

//        sheet   row    cell
log(excel.get(0).get(1).get(1));

excel.forEach(sheet -> {
    log("----------------------");
    log(sheet.getName());
    log(sheet.getSchema());
    sheet.forEach(this::log);
});

/**
* 输出:
* Bar
* ----------------------
* 基本信息
* [学号, 姓名]
* [2010000000, Foo]
* [2010000001, Bar]
* ----------------------
* sheet-1
* [foo, bar]
* [0, 1]
* [2, 4]

Versions

Version
1.0.1