diff --git a/VisualComponentsLib/Components/ComponentBigTable.cs b/VisualComponentsLib/Components/ComponentBigTable.cs index 92b4c5e..e219476 100644 --- a/VisualComponentsLib/Components/ComponentBigTable.cs +++ b/VisualComponentsLib/Components/ComponentBigTable.cs @@ -168,13 +168,17 @@ namespace VisualComponentsLib.Components } //проверка заполненности входных значений - bool CheckData(List data) + bool CheckData(List dataList) { - for (int i = 0; i < data.Count; i++) + foreach(var data in dataList) { - for (int j = 0; j < data[i].Length; j++) + foreach (var value in data.GetType().GetProperties()) { - if (string.IsNullOrEmpty(data[i][0, j])) return false; + //для простоты проверки приводим значение каждого поля к типу string + if(string.IsNullOrEmpty(value.ToString())) + { + return false; + } } } diff --git a/VisualComponentsLib/Components/ComponentWord.cs b/VisualComponentsLib/Components/ComponentWord.cs index 3e1d72c..2c70afa 100644 --- a/VisualComponentsLib/Components/ComponentWord.cs +++ b/VisualComponentsLib/Components/ComponentWord.cs @@ -92,7 +92,7 @@ namespace VisualComponentsLib.Components docRun.AppendChild(properties); - docRun.AppendChild(new Text(simpleTable.TableName)); + docRun.AppendChild(new Text(simpleTable.TableHeader)); header.AppendChild(docRun); diff --git a/VisualComponentsLib/Components/ComponentWordHistogram.cs b/VisualComponentsLib/Components/ComponentWordHistogram.cs index 94e2ea3..ebc3c6b 100644 --- a/VisualComponentsLib/Components/ComponentWordHistogram.cs +++ b/VisualComponentsLib/Components/ComponentWordHistogram.cs @@ -47,7 +47,7 @@ namespace VisualComponentsLib.Components paragraphFormat.Alignment = ParagraphAlignment.Center; paragraphFormat.KeepTogether = true; - builder.Writeln(simpleHistogram.FileName); + builder.Writeln(simpleHistogram.FileHeader); // Добавьте диаграмму с данными по умолчанию. Вы можете указать различные типы и размеры диаграмм. Shape shape = builder.InsertChart(ChartType.Column, 500, 270); diff --git a/VisualComponentsLib/Components/SupportClasses/SetDataTable.cs b/VisualComponentsLib/Components/SupportClasses/SetDataTable.cs new file mode 100644 index 0000000..f7f0253 --- /dev/null +++ b/VisualComponentsLib/Components/SupportClasses/SetDataTable.cs @@ -0,0 +1,38 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using VisualComponentsLib.Components.SupportClasses.Enums; + +namespace VisualComponentsLib.Components.SupportClasses +{ + public class SetDataTable + { + public string FilePath = string.Empty; + + public string FileHeader = string.Empty; + + //высота столбцов в заголовке + public List HeightHeaderRow = new(); + + //высота столбцов + public List HeightSimpleRow = new(); + + //высота колонок + public List WidthCol = new(); + + public List DataList; + + public SetDataTable(string filePath, string fileHeader, List heightHeaderRow, + List heightSimpleRow, List widthCol, List dataList) + { + FilePath = filePath; + FileHeader = fileHeader; + HeightHeaderRow = heightHeaderRow; + HeightSimpleRow = heightSimpleRow; + WidthCol = widthCol; + DataList = dataList; + } + } +} diff --git a/VisualComponentsLib/Components/SupportClasses/SimpleHistogram.cs b/VisualComponentsLib/Components/SupportClasses/SimpleHistogram.cs index 6fd4fb2..fade235 100644 --- a/VisualComponentsLib/Components/SupportClasses/SimpleHistogram.cs +++ b/VisualComponentsLib/Components/SupportClasses/SimpleHistogram.cs @@ -11,7 +11,7 @@ namespace VisualComponentsLib.Components.SupportClasses { public string FilePath = string.Empty; - public string FileName = string.Empty; + public string FileHeader = string.Empty; public string HistogramName = string.Empty; @@ -19,10 +19,10 @@ namespace VisualComponentsLib.Components.SupportClasses public List DataList = new(); - public SimpleHistogram(string filePath, string fileName, string histogramName, EnumAreaLegend areaLegend, List dataList) + public SimpleHistogram(string filePath, string fileHeader, string histogramName, EnumAreaLegend areaLegend, List dataList) { FilePath = filePath; - FileName = fileName; + FileHeader = fileHeader; HistogramName = histogramName; AreaLegend = areaLegend; DataList = dataList; diff --git a/VisualComponentsLib/Components/SupportClasses/SimpleTable.cs b/VisualComponentsLib/Components/SupportClasses/SimpleTable.cs index 92eb9c0..a2787a7 100644 --- a/VisualComponentsLib/Components/SupportClasses/SimpleTable.cs +++ b/VisualComponentsLib/Components/SupportClasses/SimpleTable.cs @@ -10,14 +10,14 @@ namespace VisualComponentsLib.Components.SupportClasses { public string FilePath = string.Empty; - public string TableName = string.Empty; + public string TableHeader = string.Empty; public List DataList = new(); - public SimpleTable(string filePath, string tableName, List dataList) + public SimpleTable(string filePath, string tableHeader, List dataList) { FilePath = filePath; - TableName = tableName; + TableHeader = tableHeader; DataList = dataList; } }