Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
suliangchun
dbeaver
提交
d9468902
D
dbeaver
项目概览
suliangchun
/
dbeaver
与 Fork 源项目一致
从无法访问的项目Fork
通知
2
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,发现更多精彩内容 >>
提交
d9468902
编写于
4月 14, 2018
作者:
S
serge-rider
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
XLSX export: boolean cells export
上级
e4d34558
变更
2
隐藏空白更改
内联
并排
Showing
2 changed file
with
17 addition
and
48 deletion
+17
-48
plugins/org.jkiss.dbeaver.data.office/plugin.xml
plugins/org.jkiss.dbeaver.data.office/plugin.xml
+2
-2
plugins/org.jkiss.dbeaver.data.office/src/org/jkiss/dbeaver/data/office/export/DataExporterXLSX.java
...rg/jkiss/dbeaver/data/office/export/DataExporterXLSX.java
+15
-46
未找到文件。
plugins/org.jkiss.dbeaver.data.office/plugin.xml
浏览文件 @
d9468902
...
...
@@ -18,8 +18,8 @@
<property
id=
"nullString"
label=
"%dataTransfer.processor.xlsx.property.nullString.name"
type=
"string"
description=
"%dataTransfer.processor.xlsx.property.nullString.description"
defaultValue=
""
required=
"false"
/>
<property
id=
"header"
label=
"%dataTransfer.processor.xlsx.property.header.name"
type=
"boolean"
description=
"%dataTransfer.processor.xlsx.property.header.description"
defaultValue=
"true"
required=
"true"
/>
<property
id=
"headerfont"
label=
"%dataTransfer.processor.xlsx.property.headerFont.name"
type=
"string"
description=
"%dataTransfer.processor.xlsx.property.headerFont.description"
defaultValue=
"BOLD"
required=
"false"
validValues=
"NONE,BOLD,ITALIC,STRIKEOUT,UNDERLINE"
/>
<property
id=
"trueString"
label=
"%dataTransfer.processor.xlsx.property.boolStringTrue.name"
type=
"string"
description=
"%dataTransfer.processor.xlsx.property.boolStringTrue.description"
defaultValue=
"
+
"
required=
"false"
/>
<property
id=
"falseString"
label=
"%dataTransfer.processor.xlsx.property.boolStringFalse.name"
type=
"string"
description=
"%dataTransfer.processor.xlsx.property.boolStringFalse.description"
defaultValue=
"
-
"
required=
"false"
/>
<property
id=
"trueString"
label=
"%dataTransfer.processor.xlsx.property.boolStringTrue.name"
type=
"string"
description=
"%dataTransfer.processor.xlsx.property.boolStringTrue.description"
defaultValue=
"
true
"
required=
"false"
/>
<property
id=
"falseString"
label=
"%dataTransfer.processor.xlsx.property.boolStringFalse.name"
type=
"string"
description=
"%dataTransfer.processor.xlsx.property.boolStringFalse.description"
defaultValue=
"
false
"
required=
"false"
/>
<property
id=
"exportSql"
label=
"%dataTransfer.processor.xlsx.property.exportSql.name"
type=
"boolean"
description=
"%dataTransfer.processor.xlsx.property.exportSql.description"
defaultValue=
"false"
required=
"false"
/>
<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"
/>
...
...
plugins/org.jkiss.dbeaver.data.office/src/org/jkiss/dbeaver/data/office/export/DataExporterXLSX.java
浏览文件 @
d9468902
...
...
@@ -85,8 +85,9 @@ public class DataExporterXLSX extends StreamExporterAbstract {
private
boolean
printHeader
=
false
;
private
boolean
rowNumber
=
false
;
private
String
boolTrue
=
"YES"
;
private
String
boolFalse
=
"NO"
;
private
String
boolTrue
=
"true"
;
private
String
boolFalse
=
"false"
;
private
boolean
booleRedefined
;
private
boolean
exportSql
=
false
;
private
boolean
splitSqlText
=
false
;
...
...
@@ -105,8 +106,8 @@ public class DataExporterXLSX extends StreamExporterAbstract {
properties
.
put
(
DataExporterXLSX
.
PROP_HEADER
,
true
);
properties
.
put
(
DataExporterXLSX
.
PROP_NULL_STRING
,
null
);
properties
.
put
(
DataExporterXLSX
.
PROP_HEADER_FONT
,
"BOLD"
);
properties
.
put
(
DataExporterXLSX
.
PROP_TRUESTRING
,
"
+
"
);
properties
.
put
(
DataExporterXLSX
.
PROP_FALSESTRING
,
"
-
"
);
properties
.
put
(
DataExporterXLSX
.
PROP_TRUESTRING
,
"
true
"
);
properties
.
put
(
DataExporterXLSX
.
PROP_FALSESTRING
,
"
false
"
);
properties
.
put
(
DataExporterXLSX
.
PROP_EXPORT_SQL
,
false
);
properties
.
put
(
DataExporterXLSX
.
PROP_SPLIT_SQLTEXT
,
false
);
properties
.
put
(
DataExporterXLSX
.
PROP_SPLIT_BYROWCOUNT
,
EXCEL2007MAXROWS
);
...
...
@@ -120,84 +121,53 @@ public class DataExporterXLSX extends StreamExporterAbstract {
nullString
=
nullStringProp
==
null
?
null
:
nullStringProp
.
toString
();
try
{
printHeader
=
(
Boolean
)
site
.
getProperties
().
get
(
PROP_HEADER
);
}
catch
(
Exception
e
)
{
printHeader
=
false
;
}
try
{
rowNumber
=
(
Boolean
)
site
.
getProperties
().
get
(
PROP_ROWNUMBER
);
}
catch
(
Exception
e
)
{
rowNumber
=
false
;
}
try
{
boolTrue
=
(
String
)
site
.
getProperties
().
get
(
PROP_TRUESTRING
);
}
catch
(
Exception
e
)
{
boolTrue
=
"YES"
;
boolTrue
=
"true"
;
}
try
{
boolFalse
=
(
String
)
site
.
getProperties
().
get
(
PROP_FALSESTRING
);
}
catch
(
Exception
e
)
{
boolTrue
=
"NO"
;
boolFalse
=
"false"
;
}
if
(!
"true"
.
equals
(
boolTrue
)
||
!
"false"
.
equals
(
boolFalse
))
{
booleRedefined
=
true
;
}
try
{
exportSql
=
(
Boolean
)
site
.
getProperties
().
get
(
PROP_EXPORT_SQL
);
}
catch
(
Exception
e
)
{
exportSql
=
false
;
}
try
{
splitSqlText
=
(
Boolean
)
site
.
getProperties
().
get
(
PROP_SPLIT_SQLTEXT
);
}
catch
(
Exception
e
)
{
splitSqlText
=
false
;
}
try
{
splitByRowCount
=
(
Integer
)
site
.
getProperties
().
get
(
PROP_SPLIT_BYROWCOUNT
);
}
catch
(
Exception
e
)
{
splitByRowCount
=
EXCEL2007MAXROWS
;
}
try
{
splitByCol
=
(
Integer
)
site
.
getProperties
().
get
(
PROP_SPLIT_BYCOL
);
}
catch
(
Exception
e
)
{
splitByCol
=
-
1
;
}
...
...
@@ -317,11 +287,6 @@ public class DataExporterXLSX extends StreamExporterAbstract {
super
.
dispose
();
}
@Override
public
boolean
isTextExporter
()
{
return
false
;
}
@Override
public
void
exportHeader
(
DBCSession
session
)
throws
DBException
,
IOException
{
...
...
@@ -489,7 +454,11 @@ public class DataExporterXLSX extends StreamExporterAbstract {
}
}
else
if
(
row
[
i
]
instanceof
Boolean
)
{
cell
.
setCellValue
((
Boolean
)
row
[
i
]);
if
(
booleRedefined
)
{
cell
.
setCellValue
((
Boolean
)
row
[
i
]
?
boolTrue
:
boolFalse
);
}
else
{
cell
.
setCellValue
((
Boolean
)
row
[
i
]);
}
}
else
if
(
row
[
i
]
instanceof
Number
)
{
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录