2 лаба теперь работает!!!

This commit is contained in:
Полина Чубыкина 2024-09-30 20:31:39 +04:00
parent 2ba7165ccd
commit 7d7ed2e49a
3 changed files with 24 additions and 5 deletions

View File

@ -28,6 +28,7 @@
/// </summary>
private void InitializeComponent()
{
this.components = new System.ComponentModel.Container();
this.userCheckedListBox = new Components.Components.UserCheckedListBox();
this.buttonAdd = new System.Windows.Forms.Button();
this.buttonClear = new System.Windows.Forms.Button();
@ -46,6 +47,9 @@
this.buttonExcelTable = new System.Windows.Forms.Button();
this.buttonExcelImages = new System.Windows.Forms.Button();
this.openFileDialog = new System.Windows.Forms.OpenFileDialog();
this.excelTableComponent = new Components.LogicalComponents.ExcelTableComponent(this.components);
this.excelDiagramComponent = new Components.LogicalComponents.ExcelDiagramComponent(this.components);
this.excelImagesComponent = new Components.LogicalComponents.ExcelImagesComponent(this.components);
this.SuspendLayout();
//
// userCheckedListBox
@ -194,6 +198,7 @@
this.buttonExcelDiagram.TabIndex = 19;
this.buttonExcelDiagram.Text = "Excel (Диаграмма)";
this.buttonExcelDiagram.UseVisualStyleBackColor = true;
this.buttonExcelDiagram.Click += new System.EventHandler(this.buttonExcelDiagram_Click);
//
// buttonExcelTable
//
@ -203,6 +208,7 @@
this.buttonExcelTable.TabIndex = 18;
this.buttonExcelTable.Text = "Excel (Таблица)";
this.buttonExcelTable.UseVisualStyleBackColor = true;
this.buttonExcelTable.Click += new System.EventHandler(this.buttonExcelTable_Click);
//
// buttonExcelImages
//
@ -212,6 +218,7 @@
this.buttonExcelImages.TabIndex = 17;
this.buttonExcelImages.Text = "Excel (картинки)";
this.buttonExcelImages.UseVisualStyleBackColor = true;
this.buttonExcelImages.Click += new System.EventHandler(this.buttonExcelImages_Click);
//
// openFileDialog
//
@ -265,5 +272,8 @@
private Button buttonExcelTable;
private Button buttonExcelImages;
private OpenFileDialog openFileDialog;
private Components.LogicalComponents.ExcelTableComponent excelTableComponent;
private Components.LogicalComponents.ExcelDiagramComponent excelDiagramComponent;
private Components.LogicalComponents.ExcelImagesComponent excelImagesComponent;
}
}

View File

@ -143,8 +143,8 @@ namespace WinFormsTest
openFileDialog.Dispose();
List<Bitmap> images = new List<Bitmap>();
string path = AppDomain.CurrentDomain.BaseDirectory + "test.xlsx";
//if (excelImagesComponent.createWithImages(new ExcelImageInfo(path, "Header", files))) MessageBox.Show("Успех!");
//else MessageBox.Show("Ошибка, проверьте консоль");
if (excelImagesComponent.createWithImages(new ExcelImageInfo(path, "Header", files))) MessageBox.Show("Успех!");
else MessageBox.Show("Ошибка, проверьте консоль");
}
private void buttonExcelTable_Click(object sender, EventArgs e)
@ -167,7 +167,7 @@ namespace WinFormsTest
("boxNumber", "Номер бокса"), ("phoneNumber", "Телефон"),
("isInVacation", "В отпуске"), };
//if (excelTableComponent.createWithTable(path, "test2", merges, heights, headers, workers)) MessageBox.Show("Успех");
if (excelTableComponent.createWithTable(path, "test2", merges, heights, headers, workers)) MessageBox.Show("Успех");
}
private void buttonExcelDiagram_Click(object sender, EventArgs e)
@ -178,8 +178,8 @@ namespace WinFormsTest
departments.Add(new Department("Dep 2", 500));
departments.Add(new Department("Dep 3", 170));
string path = AppDomain.CurrentDomain.BaseDirectory + "test3.xlsx";
//if (excelDiagramComponent.createWithDiagram(path, "test3", "Продажи", DiagramLegendEnum.TopRight, departments, "name", "sells")) MessageBox.Show("Успех");
//else MessageBox.Show("Fail :(");
if (excelDiagramComponent.createWithDiagram(path, "test3", "Продажи", DiagramLegendEnum.TopRight, departments, "name", "sells")) MessageBox.Show("Успех");
else MessageBox.Show("Fail :(");
}
}

View File

@ -60,4 +60,13 @@
<metadata name="openFileDialog.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
<value>17, 17</value>
</metadata>
<metadata name="excelTableComponent.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
<value>176, 17</value>
</metadata>
<metadata name="excelDiagramComponent.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
<value>380, 17</value>
</metadata>
<metadata name="excelImagesComponent.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
<value>606, 17</value>
</metadata>
</root>