2024-10-04 00:04:22 +04:00
|
|
|
|
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();
|
|
|
|
|
|
2024-10-16 01:47:44 +04:00
|
|
|
|
saver.CreateTableDocumentWithContext(filePath, header, tables);
|
2024-10-04 00:04:22 +04:00
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|