KOP/Components/Nonvisual/UserControlTableDocument.cs
2024-10-16 01:47:44 +04:00

37 lines
1.1 KiB
C#

using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Diagnostics;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace Components
{
public partial class UserControlTableDocument : Component
{
public UserControlTableDocument()
{
InitializeComponent();
}
public UserControlTableDocument(IContainer container)
{
container.Add(this);
InitializeComponent();
}
public void SaveToDocument(string filePath, string header, List<string[][]> tables)
{
if (string.IsNullOrEmpty(filePath)) throw new ArgumentNullException("Empty string instead of path to file");
if (string.IsNullOrEmpty(header)) throw new ArgumentNullException("Header string is empty");
if (tables.Count == 0) throw new ArgumentNullException("Table list is empty");
SaveToPdf saver = new SaveToPdf();
saver.CreateTableDocumentWithContext(filePath, header, tables);
}
}
}