KOP/Components/Nonvisual/UserControlTableDocument.cs

37 lines
1.0 KiB
C#
Raw Normal View History

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.CreateDoc(filePath, header, tables);
}
}
}