Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
suliangchun
dbeaver
提交
4691d4d8
D
dbeaver
项目概览
suliangchun
/
dbeaver
与 Fork 源项目一致
从无法访问的项目Fork
通知
3
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
D
dbeaver
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
4691d4d8
编写于
5月 21, 2019
作者:
S
serge-rider
浏览文件
操作
浏览文件
下载
差异文件
Merge remote-tracking branch 'origin/devel' into devel
上级
eeeb6448
758be0cc
变更
5
隐藏空白更改
内联
并排
Showing
5 changed file
with
36 addition
and
2 deletion
+36
-2
plugins/org.jkiss.dbeaver.data.office/META-INF/MANIFEST.MF
plugins/org.jkiss.dbeaver.data.office/META-INF/MANIFEST.MF
+1
-1
plugins/org.jkiss.dbeaver.data.office/OSGI-INF/l10n/bundle.properties
...jkiss.dbeaver.data.office/OSGI-INF/l10n/bundle.properties
+2
-0
plugins/org.jkiss.dbeaver.data.office/plugin.xml
plugins/org.jkiss.dbeaver.data.office/plugin.xml
+1
-0
plugins/org.jkiss.dbeaver.data.office/pom.xml
plugins/org.jkiss.dbeaver.data.office/pom.xml
+1
-1
plugins/org.jkiss.dbeaver.data.office/src/org/jkiss/dbeaver/data/office/export/DataExporterXLSX.java
...rg/jkiss/dbeaver/data/office/export/DataExporterXLSX.java
+31
-0
未找到文件。
plugins/org.jkiss.dbeaver.data.office/META-INF/MANIFEST.MF
浏览文件 @
4691d4d8
...
...
@@ -3,7 +3,7 @@ Bundle-ManifestVersion: 2
Bundle-Vendor: %Bundle-Vendor
Bundle-Name: %Bundle-Name
Bundle-SymbolicName: org.jkiss.dbeaver.data.office;singleton:=true
Bundle-Version: 1.1.4
6
.qualifier
Bundle-Version: 1.1.4
7
.qualifier
Bundle-Release-Date: 20190520
Bundle-RequiredExecutionEnvironment: JavaSE-1.8
Require-Bundle: org.eclipse.core.runtime,
...
...
plugins/org.jkiss.dbeaver.data.office/OSGI-INF/l10n/bundle.properties
浏览文件 @
4691d4d8
...
...
@@ -27,6 +27,8 @@ dataTransfer.processor.xlsx.property.splitByRowCount.name=Max row on sheet
dataTransfer.processor.xlsx.property.splitByRowCount.description
=
Split by row count
dataTransfer.processor.xlsx.property.splitByColNum.name
=
Column group
dataTransfer.processor.xlsx.property.splitByColNum.description
=
Column number for grouping rows on sheet by column value
dataTransfer.processor.xlsx.property.dateFormat.name
=
Excel date format
dataTransfer.processor.xlsx.property.dateFormat.description
=
Excel date and time format (e.g. m/d/yy h:mm) it can be changed in Excel application
category.org.jkiss.dbeaver.ext.data.office.description
=
Office Commands
category.org.jkiss.dbeaver.ext.data.office.name
=
Office
...
...
plugins/org.jkiss.dbeaver.data.office/plugin.xml
浏览文件 @
4691d4d8
...
...
@@ -28,6 +28,7 @@
<property
id=
"splitSqlText"
label=
"%dataTransfer.processor.xlsx.property.splitSqlText.name"
type=
"boolean"
description=
"%dataTransfer.processor.xlsx.property.splitSqlText.description"
defaultValue=
"false"
required=
"false"
/>
<property
id=
"splitByRowCount"
label=
"%dataTransfer.processor.xlsx.property.splitByRowCount.name"
type=
"integer"
description=
"%dataTransfer.processor.xlsx.property.splitByRowCount.description"
defaultValue=
"1048575"
required=
"false"
/>
<property
id=
"splitByColNum"
label=
"%dataTransfer.processor.xlsx.property.splitByColNum.name"
type=
"integer"
description=
"%dataTransfer.processor.xlsx.property.splitByColNum.description"
defaultValue=
"0"
required=
"false"
/>
<property
id=
"dateFormat"
label=
"%dataTransfer.processor.xlsx.property.dateFormat.name"
type=
"string"
description=
"%dataTransfer.processor.xlsx.property.dateFormat.description"
defaultValue=
"m/d/yy"
required=
"false"
validValues=
"m/d/yy,d-mmm-yy,d-mmm,mmm-yy,h:mm AM/PM,h:mm:ss AM/PM,h:mm,h:mm:ss,m/d/yy h:mm"
/>
</propertyGroup>
</processor>
</node>
...
...
plugins/org.jkiss.dbeaver.data.office/pom.xml
浏览文件 @
4691d4d8
...
...
@@ -10,7 +10,7 @@
<relativePath>
../
</relativePath>
</parent>
<artifactId>
org.jkiss.dbeaver.data.office
</artifactId>
<version>
1.1.4
6
-SNAPSHOT
</version>
<version>
1.1.4
7
-SNAPSHOT
</version>
<packaging>
eclipse-plugin
</packaging>
</project>
plugins/org.jkiss.dbeaver.data.office/src/org/jkiss/dbeaver/data/office/export/DataExporterXLSX.java
浏览文件 @
4691d4d8
...
...
@@ -44,6 +44,7 @@ import org.jkiss.utils.CommonUtils;
import
java.io.IOException
;
import
java.io.Reader
;
import
java.util.Date
;
import
java.util.HashMap
;
import
java.util.List
;
import
java.util.Map
;
...
...
@@ -72,6 +73,8 @@ public class DataExporterXLSX extends StreamExporterAbstract {
private
static
final
String
PROP_SPLIT_BYROWCOUNT
=
"splitByRowCount"
;
private
static
final
String
PROP_SPLIT_BYCOL
=
"splitByColNum"
;
private
static
final
String
PROP_DATE_FORMAT
=
"dateFormat"
;
private
static
final
int
EXCEL2007MAXROWS
=
1048575
;
private
boolean
showDescription
;
...
...
@@ -93,12 +96,14 @@ public class DataExporterXLSX extends StreamExporterAbstract {
private
boolean
booleRedefined
;
private
boolean
exportSql
=
false
;
private
boolean
splitSqlText
=
false
;
private
String
dateFormat
=
""
;
private
int
splitByRowCount
=
EXCEL2007MAXROWS
;
private
int
splitByCol
=
0
;
private
int
rowCount
=
0
;
private
XSSFCellStyle
style
;
private
XSSFCellStyle
styleDate
;
private
XSSFCellStyle
styleHeader
;
private
HashMap
<
Object
,
Worksheet
>
worksheets
;
...
...
@@ -116,6 +121,7 @@ public class DataExporterXLSX extends StreamExporterAbstract {
properties
.
put
(
DataExporterXLSX
.
PROP_SPLIT_SQLTEXT
,
false
);
properties
.
put
(
DataExporterXLSX
.
PROP_SPLIT_BYROWCOUNT
,
EXCEL2007MAXROWS
);
properties
.
put
(
DataExporterXLSX
.
PROP_SPLIT_BYCOL
,
0
);
properties
.
put
(
DataExporterXLSX
.
PROP_DATE_FORMAT
,
""
);
return
properties
;
}
...
...
@@ -173,6 +179,12 @@ public class DataExporterXLSX extends StreamExporterAbstract {
}
catch
(
Exception
e
)
{
splitByCol
=
-
1
;
}
try
{
dateFormat
=
(
String
)
site
.
getProperties
().
get
(
PROP_DATE_FORMAT
);
}
catch
(
Exception
e
)
{
dateFormat
=
""
;
}
wb
=
new
SXSSFWorkbook
(
ROW_WINDOW
);
...
...
@@ -243,6 +255,20 @@ public class DataExporterXLSX extends StreamExporterAbstract {
style
.
setBorderBottom
(
border
);
style
.
setBorderLeft
(
border
);
style
.
setBorderRight
(
border
);
styleDate
=
(
XSSFCellStyle
)
wb
.
createCellStyle
();
styleDate
.
setBorderTop
(
border
);
styleDate
.
setBorderBottom
(
border
);
styleDate
.
setBorderLeft
(
border
);
styleDate
.
setBorderRight
(
border
);
if
(
dateFormat
==
null
||
dateFormat
.
length
()
==
0
)
{
styleDate
.
setDataFormat
((
short
)
14
);
}
else
{
styleDate
.
setDataFormat
(
wb
.
getCreationHelper
().
createDataFormat
().
getFormat
(
dateFormat
));
}
this
.
rowCount
=
0
;
super
.
init
(
site
);
...
...
@@ -466,6 +492,11 @@ public class DataExporterXLSX extends StreamExporterAbstract {
cell
.
setCellValue
(((
Number
)
row
[
i
]).
doubleValue
());
}
else
if
(
row
[
i
]
instanceof
Date
)
{
cell
.
setCellValue
((
Date
)
row
[
i
]);
cell
.
setCellStyle
(
styleDate
);
}
else
{
String
stringValue
=
super
.
getValueDisplayString
(
column
,
row
[
i
]);
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录