Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
K
Kivii.Client.OfficeSample
Project
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
示例代码
Kivii.Client.OfficeSample
Commits
91b7839a
Commit
91b7839a
authored
Dec 05, 2020
by
施晓雨
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
更新版本
parent
92f507a9
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
95 additions
and
94 deletions
+95
-94
FrmMain.Designer.cs
Kivii.Client.OfficeSample/FrmMain.Designer.cs
+77
-77
FrmMain.cs
Kivii.Client.OfficeSample/FrmMain.cs
+8
-8
Kivii.Client.OfficeSample.csproj
Kivii.Client.OfficeSample/Kivii.Client.OfficeSample.csproj
+6
-6
packages.config
Kivii.Client.OfficeSample/packages.config
+4
-3
首页模板.xlsx
Kivii.Client.OfficeSample/首页模板.xlsx
+0
-0
No files found.
Kivii.Client.OfficeSample/FrmMain.Designer.cs
View file @
91b7839a
This diff is collapsed.
Click to expand it.
Kivii.Client.OfficeSample/FrmMain.cs
View file @
91b7839a
...
...
@@ -78,27 +78,27 @@ namespace Kivii.Client.OfficeSample
Stopwatch
watch
=
new
Stopwatch
();
watch
.
Start
();
//创建个模板引擎
var
template
=
new
Template
Excel
();
var
template
=
new
Template
Workbook
();
template
.
Open
(
tbxTemplateFileName
.
Text
);
//打开模板文件
template
.
Bind
(
"contract"
,
_contract
);
//将数据绑定到模板中,注意contract在模板中这是这个变量名了
template
.
Bind
(
"task"
,
_tasks
);
var
rtns
=
template
.
Fill
();
//填充模板
var
rtns
=
template
.
Execute
();
//填充模板
var
template2
=
new
Template
Excel
();
var
template2
=
new
Template
Workbook
();
template2
.
Open
(
tbxTemplateFileName2
.
Text
);
//打开模板文件
template2
.
Bind
(
"contract"
,
_contract
);
//将数据绑定到模板中,注意contract在模板中这是这个变量名了
template2
.
Bind
(
"task"
,
_tasks
);
var
rtns2
=
template2
.
Fill
();
//填充模板
var
rtns2
=
template2
.
Execute
();
//填充模板
var
template3
=
new
Template
Excel
();
var
template3
=
new
Template
Workbook
();
template3
.
Open
(
tbxTemplateFileName3
.
Text
);
//打开模板文件
template3
.
Bind
(
"contract"
,
_contract
);
//将数据绑定到模板中,注意contract在模板中这是这个变量名了
template3
.
Bind
(
"task"
,
_tasks
);
var
rtns3
=
template3
.
Fill
();
//填充模板
var
rtns3
=
template3
.
Execute
();
//填充模板
//合并两个模板
template
.
Contact
(
template2
.
Package
);
template
.
Contact
(
template3
.
Package
);
template
.
Contact
(
template2
.
Excel
Package
);
template
.
Contact
(
template3
.
Excel
Package
);
template
.
SaveAs
(
saveFileName
);
//最后另存当前的文件
watch
.
Stop
();
...
...
Kivii.Client.OfficeSample/Kivii.Client.OfficeSample.csproj
View file @
91b7839a
...
...
@@ -32,14 +32,14 @@
<WarningLevel>
4
</WarningLevel>
</PropertyGroup>
<ItemGroup>
<Reference
Include=
"Kivii.Common.V4.0, Version=5.
4.2019.925
0, Culture=neutral, processorArchitecture=MSIL"
>
<HintPath>
..\packages\Kivii.Common.5.
4.2019.925
0\lib\net40\Kivii.Common.V4.0.dll
</HintPath>
<Reference
Include=
"Kivii.Common.V4.0, Version=5.
5.2020.928
0, Culture=neutral, processorArchitecture=MSIL"
>
<HintPath>
..\packages\Kivii.Common.5.
5.2020.928
0\lib\net40\Kivii.Common.V4.0.dll
</HintPath>
</Reference>
<Reference
Include=
"Kivii.Core.V4.0, Version=5.
4.2019.925
0, Culture=neutral, processorArchitecture=MSIL"
>
<HintPath>
..\packages\Kivii.Core.5.
4.2019.925
0\lib\net40\Kivii.Core.V4.0.dll
</HintPath>
<Reference
Include=
"Kivii.Core.V4.0, Version=5.
5.2020.700
0, Culture=neutral, processorArchitecture=MSIL"
>
<HintPath>
..\packages\Kivii.Core.5.
5.2020.700
0\lib\net40\Kivii.Core.V4.0.dll
</HintPath>
</Reference>
<Reference
Include=
"Kivii.Office.OpenXml.V4.0, Version=5.
4.2019.10000
, Culture=neutral, processorArchitecture=MSIL"
>
<HintPath>
..\packages\Kivii.Office.OpenXml.5.4.2019.10
000
\lib\net40\Kivii.Office.OpenXml.V4.0.dll
</HintPath>
<Reference
Include=
"Kivii.Office.OpenXml.V4.0, Version=5.
5.2020.10132
, Culture=neutral, processorArchitecture=MSIL"
>
<HintPath>
..\packages\Kivii.Office.OpenXml.5.4.2019.10
132
\lib\net40\Kivii.Office.OpenXml.V4.0.dll
</HintPath>
</Reference>
<Reference
Include=
"System"
/>
<Reference
Include=
"System.Core"
/>
...
...
Kivii.Client.OfficeSample/packages.config
View file @
91b7839a
<?
xml
version
=
"1.0"
encoding
=
"utf-8"
?>
<
packages
>
<
package
id
=
"Kivii.Common"
version
=
"5.
4.2019.925
0"
targetFramework
=
"net40"
/>
<
package
id
=
"Kivii.Core"
version
=
"5.
4.2019.925
0"
targetFramework
=
"net40"
/>
<
package
id
=
"Kivii.Office.OpenXml"
version
=
"5.4.2019.10
000
"
targetFramework
=
"net40"
/>
<
package
id
=
"Kivii.Common"
version
=
"5.
5.2020.928
0"
targetFramework
=
"net40"
/>
<
package
id
=
"Kivii.Core"
version
=
"5.
5.2020.700
0"
targetFramework
=
"net40"
/>
<
package
id
=
"Kivii.Office.OpenXml"
version
=
"5.4.2019.10
132
"
targetFramework
=
"net40"
/>
</
packages
>
\ No newline at end of file
Kivii.Client.OfficeSample/首页模板.xlsx
View file @
91b7839a
No preview for this file type
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment