Commit 91b7839a by 施晓雨

更新版本

parent 92f507a9
......@@ -41,23 +41,23 @@
this.pgResult = new System.Windows.Forms.PropertyGrid();
this.groupBox1 = new System.Windows.Forms.GroupBox();
this.panel2 = new System.Windows.Forms.Panel();
this.groupBox2 = new System.Windows.Forms.GroupBox();
this.tbxTemplateFileName2 = new System.Windows.Forms.TextBox();
this.btnSelectTemplateFile2 = new System.Windows.Forms.Button();
this.label4 = new System.Windows.Forms.Label();
this.lblSpendTime = new System.Windows.Forms.Label();
this.dgTasks = new System.Windows.Forms.DataGridView();
this.Title = new System.Windows.Forms.DataGridViewTextBoxColumn();
this.Column1 = new System.Windows.Forms.DataGridViewTextBoxColumn();
this.Column2 = new System.Windows.Forms.DataGridViewTextBoxColumn();
this.label5 = new System.Windows.Forms.Label();
this.btnSelectTemplateFile3 = new System.Windows.Forms.Button();
this.lblSpendTime = new System.Windows.Forms.Label();
this.groupBox2 = new System.Windows.Forms.GroupBox();
this.tbxTemplateFileName3 = new System.Windows.Forms.TextBox();
this.tbxTemplateFileName2 = new System.Windows.Forms.TextBox();
this.btnSelectTemplateFile3 = new System.Windows.Forms.Button();
this.btnSelectTemplateFile2 = new System.Windows.Forms.Button();
this.label5 = new System.Windows.Forms.Label();
this.label4 = new System.Windows.Forms.Label();
this.panel1.SuspendLayout();
this.groupBox1.SuspendLayout();
this.panel2.SuspendLayout();
this.groupBox2.SuspendLayout();
((System.ComponentModel.ISupportInitialize)(this.dgTasks)).BeginInit();
this.groupBox2.SuspendLayout();
this.SuspendLayout();
//
// btnGetReport
......@@ -184,62 +184,6 @@
this.panel2.Size = new System.Drawing.Size(601, 736);
this.panel2.TabIndex = 5;
//
// groupBox2
//
this.groupBox2.Controls.Add(this.tbxTemplateFileName3);
this.groupBox2.Controls.Add(this.tbxTemplateFileName2);
this.groupBox2.Controls.Add(this.tbxTemplateFileName);
this.groupBox2.Controls.Add(this.btnGenerateXlsx);
this.groupBox2.Controls.Add(this.btnSelectTemplateFile3);
this.groupBox2.Controls.Add(this.btnSelectTemplateFile2);
this.groupBox2.Controls.Add(this.btnSelectTemplateFile);
this.groupBox2.Controls.Add(this.label5);
this.groupBox2.Controls.Add(this.label4);
this.groupBox2.Controls.Add(this.label3);
this.groupBox2.Dock = System.Windows.Forms.DockStyle.Top;
this.groupBox2.Location = new System.Drawing.Point(0, 0);
this.groupBox2.Name = "groupBox2";
this.groupBox2.Size = new System.Drawing.Size(601, 95);
this.groupBox2.TabIndex = 0;
this.groupBox2.TabStop = false;
this.groupBox2.Text = "生成选项";
//
// tbxTemplateFileName2
//
this.tbxTemplateFileName2.Location = new System.Drawing.Point(85, 41);
this.tbxTemplateFileName2.Name = "tbxTemplateFileName2";
this.tbxTemplateFileName2.Size = new System.Drawing.Size(162, 21);
this.tbxTemplateFileName2.TabIndex = 2;
//
// btnSelectTemplateFile2
//
this.btnSelectTemplateFile2.Location = new System.Drawing.Point(253, 40);
this.btnSelectTemplateFile2.Name = "btnSelectTemplateFile2";
this.btnSelectTemplateFile2.Size = new System.Drawing.Size(50, 23);
this.btnSelectTemplateFile2.TabIndex = 0;
this.btnSelectTemplateFile2.Text = "...";
this.btnSelectTemplateFile2.UseVisualStyleBackColor = true;
this.btnSelectTemplateFile2.Click += new System.EventHandler(this.btnSelectTemplateFile2_Click);
//
// label4
//
this.label4.AutoSize = true;
this.label4.Location = new System.Drawing.Point(15, 44);
this.label4.Name = "label4";
this.label4.Size = new System.Drawing.Size(59, 12);
this.label4.TabIndex = 1;
this.label4.Text = "选择模板2";
//
// lblSpendTime
//
this.lblSpendTime.AutoSize = true;
this.lblSpendTime.Dock = System.Windows.Forms.DockStyle.Bottom;
this.lblSpendTime.Location = new System.Drawing.Point(0, 724);
this.lblSpendTime.Name = "lblSpendTime";
this.lblSpendTime.Size = new System.Drawing.Size(65, 12);
this.lblSpendTime.TabIndex = 2;
this.lblSpendTime.Text = "生成时间:";
//
// dgTasks
//
this.dgTasks.ColumnHeadersHeightSizeMode = System.Windows.Forms.DataGridViewColumnHeadersHeightSizeMode.AutoSize;
......@@ -275,14 +219,49 @@
this.Column2.Name = "Column2";
this.Column2.ReadOnly = true;
//
// label5
// lblSpendTime
//
this.label5.AutoSize = true;
this.label5.Location = new System.Drawing.Point(15, 69);
this.label5.Name = "label5";
this.label5.Size = new System.Drawing.Size(59, 12);
this.label5.TabIndex = 1;
this.label5.Text = "选择模板3";
this.lblSpendTime.AutoSize = true;
this.lblSpendTime.Dock = System.Windows.Forms.DockStyle.Bottom;
this.lblSpendTime.Location = new System.Drawing.Point(0, 724);
this.lblSpendTime.Name = "lblSpendTime";
this.lblSpendTime.Size = new System.Drawing.Size(65, 12);
this.lblSpendTime.TabIndex = 2;
this.lblSpendTime.Text = "生成时间:";
//
// groupBox2
//
this.groupBox2.Controls.Add(this.tbxTemplateFileName3);
this.groupBox2.Controls.Add(this.tbxTemplateFileName2);
this.groupBox2.Controls.Add(this.tbxTemplateFileName);
this.groupBox2.Controls.Add(this.btnGenerateXlsx);
this.groupBox2.Controls.Add(this.btnSelectTemplateFile3);
this.groupBox2.Controls.Add(this.btnSelectTemplateFile2);
this.groupBox2.Controls.Add(this.btnSelectTemplateFile);
this.groupBox2.Controls.Add(this.label5);
this.groupBox2.Controls.Add(this.label4);
this.groupBox2.Controls.Add(this.label3);
this.groupBox2.Dock = System.Windows.Forms.DockStyle.Top;
this.groupBox2.Location = new System.Drawing.Point(0, 0);
this.groupBox2.Name = "groupBox2";
this.groupBox2.Size = new System.Drawing.Size(601, 95);
this.groupBox2.TabIndex = 0;
this.groupBox2.TabStop = false;
this.groupBox2.Text = "生成选项";
//
// tbxTemplateFileName3
//
this.tbxTemplateFileName3.Location = new System.Drawing.Point(85, 66);
this.tbxTemplateFileName3.Name = "tbxTemplateFileName3";
this.tbxTemplateFileName3.Size = new System.Drawing.Size(162, 21);
this.tbxTemplateFileName3.TabIndex = 2;
//
// tbxTemplateFileName2
//
this.tbxTemplateFileName2.Location = new System.Drawing.Point(85, 41);
this.tbxTemplateFileName2.Name = "tbxTemplateFileName2";
this.tbxTemplateFileName2.Size = new System.Drawing.Size(162, 21);
this.tbxTemplateFileName2.TabIndex = 2;
//
// btnSelectTemplateFile3
//
......@@ -294,12 +273,33 @@
this.btnSelectTemplateFile3.UseVisualStyleBackColor = true;
this.btnSelectTemplateFile3.Click += new System.EventHandler(this.btnSelectTemplateFile3_Click);
//
// tbxTemplateFileName3
// btnSelectTemplateFile2
//
this.tbxTemplateFileName3.Location = new System.Drawing.Point(85, 66);
this.tbxTemplateFileName3.Name = "tbxTemplateFileName3";
this.tbxTemplateFileName3.Size = new System.Drawing.Size(162, 21);
this.tbxTemplateFileName3.TabIndex = 2;
this.btnSelectTemplateFile2.Location = new System.Drawing.Point(253, 40);
this.btnSelectTemplateFile2.Name = "btnSelectTemplateFile2";
this.btnSelectTemplateFile2.Size = new System.Drawing.Size(50, 23);
this.btnSelectTemplateFile2.TabIndex = 0;
this.btnSelectTemplateFile2.Text = "...";
this.btnSelectTemplateFile2.UseVisualStyleBackColor = true;
this.btnSelectTemplateFile2.Click += new System.EventHandler(this.btnSelectTemplateFile2_Click);
//
// label5
//
this.label5.AutoSize = true;
this.label5.Location = new System.Drawing.Point(15, 69);
this.label5.Name = "label5";
this.label5.Size = new System.Drawing.Size(59, 12);
this.label5.TabIndex = 1;
this.label5.Text = "选择模板3";
//
// label4
//
this.label4.AutoSize = true;
this.label4.Location = new System.Drawing.Point(15, 44);
this.label4.Name = "label4";
this.label4.Size = new System.Drawing.Size(59, 12);
this.label4.TabIndex = 1;
this.label4.Text = "选择模板2";
//
// FrmMain
//
......@@ -316,9 +316,9 @@
this.groupBox1.PerformLayout();
this.panel2.ResumeLayout(false);
this.panel2.PerformLayout();
((System.ComponentModel.ISupportInitialize)(this.dgTasks)).EndInit();
this.groupBox2.ResumeLayout(false);
this.groupBox2.PerformLayout();
((System.ComponentModel.ISupportInitialize)(this.dgTasks)).EndInit();
this.ResumeLayout(false);
}
......
......@@ -78,27 +78,27 @@ namespace Kivii.Client.OfficeSample
Stopwatch watch = new Stopwatch();
watch.Start();
//创建个模板引擎
var template = new TemplateExcel();
var template = new TemplateWorkbook();
template.Open(tbxTemplateFileName.Text);//打开模板文件
template.Bind("contract", _contract);//将数据绑定到模板中,注意contract在模板中这是这个变量名了
template.Bind("task", _tasks);
var rtns =template.Fill();//填充模板
var rtns =template.Execute();//填充模板
var template2 = new TemplateExcel();
var template2 = new TemplateWorkbook();
template2.Open(tbxTemplateFileName2.Text);//打开模板文件
template2.Bind("contract", _contract);//将数据绑定到模板中,注意contract在模板中这是这个变量名了
template2.Bind("task", _tasks);
var rtns2 = template2.Fill();//填充模板
var rtns2 = template2.Execute();//填充模板
var template3 = new TemplateExcel();
var template3 = new TemplateWorkbook();
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.ExcelPackage);
template.Contact(template3.ExcelPackage);
template.SaveAs(saveFileName);//最后另存当前的文件
watch.Stop();
......
......@@ -32,14 +32,14 @@
<WarningLevel>4</WarningLevel>
</PropertyGroup>
<ItemGroup>
<Reference Include="Kivii.Common.V4.0, Version=5.4.2019.9250, Culture=neutral, processorArchitecture=MSIL">
<HintPath>..\packages\Kivii.Common.5.4.2019.9250\lib\net40\Kivii.Common.V4.0.dll</HintPath>
<Reference Include="Kivii.Common.V4.0, Version=5.5.2020.9280, Culture=neutral, processorArchitecture=MSIL">
<HintPath>..\packages\Kivii.Common.5.5.2020.9280\lib\net40\Kivii.Common.V4.0.dll</HintPath>
</Reference>
<Reference Include="Kivii.Core.V4.0, Version=5.4.2019.9250, Culture=neutral, processorArchitecture=MSIL">
<HintPath>..\packages\Kivii.Core.5.4.2019.9250\lib\net40\Kivii.Core.V4.0.dll</HintPath>
<Reference Include="Kivii.Core.V4.0, Version=5.5.2020.7000, Culture=neutral, processorArchitecture=MSIL">
<HintPath>..\packages\Kivii.Core.5.5.2020.7000\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.10000\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.10132\lib\net40\Kivii.Office.OpenXml.V4.0.dll</HintPath>
</Reference>
<Reference Include="System" />
<Reference Include="System.Core" />
......
<?xml version="1.0" encoding="utf-8"?>
<packages>
<package id="Kivii.Common" version="5.4.2019.9250" targetFramework="net40" />
<package id="Kivii.Core" version="5.4.2019.9250" targetFramework="net40" />
<package id="Kivii.Office.OpenXml" version="5.4.2019.10000" targetFramework="net40" />
<package id="Kivii.Common" version="5.5.2020.9280" targetFramework="net40" />
<package id="Kivii.Core" version="5.5.2020.7000" targetFramework="net40" />
<package id="Kivii.Office.OpenXml" version="5.4.2019.10132" targetFramework="net40" />
</packages>
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment