41 lines
956 B
C#
Raw Normal View History

2024-10-06 14:23:43 +04:00
using KryukovLib.Helpers;
using KryukovLib.Models;
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Diagnostics;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace KryukovLib
{
public partial class ExcelTable : Component
{
public ExcelTable()
{
InitializeComponent();
}
public ExcelTable(IContainer container)
{
container.Add(this);
InitializeComponent();
}
public void CreateDoc(TableConfig config)
{
config.CheckFields();
IContext creator = new WorkWithExcel();
creator.CreateHeader(config.Header);
if (config.Data != null)
foreach (var datum in config.Data)
{
creator.CreateTable(datum);
}
creator.SaveDoc(config.FilePath);
}
}
}