├── .classpath
├── .gitignore
├── .project
├── LICENSE
├── pom.xml
├── readme.md
└── src
├── main
└── java
│ └── com
│ └── duowan
│ └── leopard
│ └── officeutil
│ └── excel
│ ├── ExportExcelUtil.java
│ ├── annotation
│ ├── ExcelSheet.java
│ └── SheetCol.java
│ └── bean
│ └── ExportExcelBean.java
└── test
└── java
└── com
└── duowan
└── leopard
└── officeutil
└── excel
├── ExtendUtil.java
├── MainTest.java
├── TestBean.java
└── TestExtend.java
/.classpath:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
27 |
--------------------------------------------------------------------------------
/.gitignore:
--------------------------------------------------------------------------------
1 | /target/
2 |
3 | /.settings/
4 | /target/
5 | /target/
6 | /target/
7 | /target/
8 | /target/
9 | /target/
10 | /target/
11 | /target/
12 | /target/
13 | /target/
14 | /target/
15 | /target/
16 | /target/
17 | /target/
18 | /target/
19 | /target/
20 | /target/
21 | /target/
22 | /target/
23 | /target/
24 | /target/
25 | /target/
26 | /target/
27 | /target/
28 | /target/
29 | /target/
30 | /target/
31 | /target/
32 | /target/
33 | /target/
34 | /target/
35 | /target/
36 | /target/
37 | /target/
38 | /target/
39 | /target/
40 | /target/
41 | /target/
42 | /target/
43 | /target/
44 | /target/
45 | /target/
46 | /target/
47 | /target/
48 | /target/
49 | /target/
50 | /target/
51 | /target/
52 | /target/
53 | /target/
54 | /target/
55 | /target/
56 | /target/
57 | /target/
58 | /target/
59 | /target/
60 | /target/
61 | /target/
62 | /target/
63 | /target/
64 | /target/
65 | /target/
66 | /target/
67 | /target/
68 | /target/
69 | /target/
70 | /target/
71 | /target/
72 | /target/
73 | /target/
74 | /target/
75 | /target/
76 | /target/
77 | /target/
78 | /target/
79 | /target/
80 | /target/
81 | /target/
82 | /target/
83 | /target/
84 | /target/
85 | /target/
86 | /target/
87 | /target/
88 | /target/
89 | /target/
90 | /target/
91 | /target/
92 | /target/
93 | /target/
94 | /target/
95 | /target/
96 | /target/
97 | /target/
98 | /target/
99 | /target/
100 | /target/
101 | /target/
102 | /target/
103 | /target/
104 | /target/
105 | /target/
106 | /target/
107 | /target/
108 | /target/
109 | /target/
110 | /target/
111 | /target/
112 | /target/
113 | /target/
114 | /target/
115 | /target/
116 | /target/
117 | /target/
118 | /target/
119 | /target/
120 | /target/
121 | /target/
122 | /target/
123 | /target/
124 | /target/
125 | /target/
126 | /target/
127 | /target/
128 | /target/
129 | /target/
130 | /target/
131 | /target/
132 | /target/
133 | /target/
134 | /target/
135 | /target/
136 | /target/
137 | /target/
138 | /target/
139 | /target/
140 | /target/
141 | /target/
142 | /target/
143 | /target/
144 | /target/
145 | /target/
146 | /target/
147 | /target/
148 | /target/
149 | /target/
150 | /target/
151 | /target/
152 | /target/
153 | /target/
154 | /target/
155 | /target/
156 | /target/
157 | /target/
158 | /target/
159 | /target/
160 | /target/
161 | /target/
162 | /target/
163 | /target/
164 | /target/
165 | /target/
166 | /target/
167 | /target/
168 | /target/
169 | /target/
170 | /target/
171 | /target/
172 | /target/
173 | /target/
174 | /target/
175 | /target/
176 | /target/
177 | /target/
178 | /target/
179 | /target/
180 | /target/
181 | /target/
182 | /target/
183 | /target/
184 | /target/
185 | /target/
186 | /target/
187 | /target/
188 | /target/
189 | /target/
190 | /target/
191 | /target/
192 | /target/
193 | /target/
194 | /target/
195 | /target/
196 | /target/
197 | /target/
198 | /target/
199 | /target/
200 | /target/
201 | /target/
202 | /target/
203 | /target/
204 | /target/
205 | /target/
206 | /target/
207 | /target/
208 | /target/
209 | /target/
210 | /target/
211 | /target/
212 | /target/
213 | /target/
214 | /target/
215 | /target/
216 | /target/
217 | /target/
218 | /target/
219 | /target/
220 | /target/
221 | /target/
222 | /target/
223 | /target/
224 | /target/
225 | /target/
226 | /target/
227 | /target/
228 | /target/
229 | /target/
230 | /target/
231 | /target/
232 |
--------------------------------------------------------------------------------
/.project:
--------------------------------------------------------------------------------
1 |
2 |
3 | excel
4 |
5 |
6 |
7 |
8 |
9 | org.eclipse.jdt.core.javabuilder
10 |
11 |
12 |
13 |
14 | org.eclipse.m2e.core.maven2Builder
15 |
16 |
17 |
18 |
19 |
20 | org.eclipse.jdt.core.javanature
21 | org.eclipse.m2e.core.maven2Nature
22 |
23 |
24 |
--------------------------------------------------------------------------------
/LICENSE:
--------------------------------------------------------------------------------
1 | The MIT License (MIT)
2 |
3 | Copyright (c) 2015 giantray
4 |
5 | Permission is hereby granted, free of charge, to any person obtaining a copy
6 | of this software and associated documentation files (the "Software"), to deal
7 | in the Software without restriction, including without limitation the rights
8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9 | copies of the Software, and to permit persons to whom the Software is
10 | furnished to do so, subject to the following conditions:
11 |
12 | The above copyright notice and this permission notice shall be included in all
13 | copies or substantial portions of the Software.
14 |
15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21 | SOFTWARE.
22 |
23 |
--------------------------------------------------------------------------------
/pom.xml:
--------------------------------------------------------------------------------
1 |
3 | 4.0.0
4 |
5 | com.github.giantray
6 | exceltool
7 | 0.95
8 | jar
9 |
10 | exceltool
11 | a tool to create excel.
12 | https://github.com/giantray/ExcelTool
13 |
14 |
15 |
16 | The Apache Software License, Version 2.0
17 | http://www.apache.org/licenses/LICENSE-2.0.txt
18 |
19 |
20 |
21 |
22 |
23 | lizeyang
24 | 51961070@qq.com
25 |
26 |
27 |
28 |
29 | scm:git:https://github.com/giantray/ExcelTool.git
30 | scm:git:git@github.com:giantray/ExcelTool.git
31 | https://github.com/giantray/ExcelTool
32 |
33 |
34 |
35 |
36 |
37 | UTF-8
38 |
39 |
40 |
41 |
42 | junit
43 | junit
44 | 4.12
45 | test
46 |
47 |
48 |
49 | net.sourceforge.jexcelapi
50 | jxl
51 | 2.6.10
52 |
53 |
54 |
55 |
56 |
57 |
58 | release
59 |
60 |
61 |
62 |
63 | org.apache.maven.plugins
64 | maven-source-plugin
65 | 2.2.1
66 |
67 |
68 | package
69 |
70 | jar-no-fork
71 |
72 |
73 |
74 |
75 |
76 |
77 | org.apache.maven.plugins
78 | maven-javadoc-plugin
79 | 2.9.1
80 |
81 |
82 | package
83 |
84 | jar
85 |
86 |
87 |
88 |
89 |
90 |
91 | org.apache.maven.plugins
92 | maven-gpg-plugin
93 | 1.5
94 |
95 |
96 | verify
97 |
98 | sign
99 |
100 |
101 |
102 |
103 |
104 |
105 |
106 |
107 | oss
108 | https://oss.sonatype.org/content/repositories/snapshots/
109 |
110 |
111 | oss
112 | https://oss.sonatype.org/service/local/staging/deploy/maven2/
113 |
114 |
115 |
116 |
117 |
118 |
119 |
120 |
121 |
122 | org.apache.maven.plugins
123 | maven-compiler-plugin
124 | 2.3
125 |
126 | 1.6
127 | 1.6
128 | UTF-8
129 |
130 |
131 |
132 |
133 | org.apache.maven.plugins
134 | maven-source-plugin
135 | 2.1.2
136 |
137 |
138 | attach-sources
139 |
140 | jar
141 |
142 |
143 |
144 |
145 |
146 | org.apache.maven.plugins
147 | maven-javadoc-plugin
148 | 2.7
149 |
150 |
151 | org.apache.maven.plugins
152 | maven-release-plugin
153 | 2.4
154 |
155 |
156 |
157 |
158 |
--------------------------------------------------------------------------------
/readme.md:
--------------------------------------------------------------------------------
1 | ##概述
2 | 通过对Jxl包的简单封装,这个组件提供了一个更加灵活、简单地生成excel表格的方法。
3 | 在生成excel时,你只需编码,把数据塞到指定的bean中,之后生成excel的其他细节,交给这个工具。这个工具已经对excel样式做了较佳的设置,可以省却你调试excel样式的痛苦
4 |
5 | ##特性
6 | - **解耦** 在jxl包基础上做了小扩展,程序员只要专注塞数据——把数据塞到我们提供的bean。之后bean转excel,由这个组件搞定。该组件已经优化了表格样式,可以省却调试excel样式的痛苦
7 | - **灵活排序** 可以很方便地调整每列的先后顺序
8 | - **宽度自适应** 针对中文做优化,确保excel表格能依据文字宽度确定每个表格宽度
9 | - **值类型自动识别** 检测每个表格的内容,是数字、字符串、还是时间,依据类型的不同,做人性化、合理的显示
10 |
11 | ##引入
12 | maven依赖
13 |
14 | ```xml
15 |
16 | com.github.giantray
17 | exceltool
18 | 0.95
19 |
20 | ```
21 | 当前版本为0.95
22 |
23 |
24 | ##如何使用
25 | 提供了两种使用方式,一种是基于传参的方式,一种是基于注解的方式。
26 |
27 | ###2、基于传参
28 | 所谓基于参数,是指excel中要展示的列,列名,顺序等通过构建一个参数bean来指定。
29 |
30 | 2.1、在MainTest类中,提供了一个测试类,为你演示了如何生成,建议您直接看看测试类中的demo。下面介绍这个demo
31 |
32 | 2.2、首先,demo代码中,会将数据塞到ExportExcelBean这个类中
33 | ```java
34 | List