Beispiel #1
0
        public static void Create(string fileName, string sheetName)
        {
            IWorkbook workbook = WorkbookHelper.Create(fileName);

            if (workbook == null)
            {
                throw new Exception("Cannot create IWorkbook object!");
            }

            workbook.CreateSheet(sheetName);
            Create(workbook, fileName);
        }
Beispiel #2
0
        public static void Create(string templateFileName, string fileName, string sheetName, DataTable table)
        {
            if (!File.Exists(templateFileName))
            {
                throw new Exception("Template file not found!");
            }

            if (File.Exists(fileName))
            {
                throw new Exception("File exists!");
            }

            IWorkbook templateWorkbook = WorkbookHelper.CreateInputWorkbook(templateFileName);

            if (templateWorkbook == null)
            {
                throw new Exception("Cannot create IWorkbook object!");
            }

            IWorkbook workbook = WorkbookHelper.Append(templateWorkbook, sheetName, table);

            Create(workbook, fileName);
        }
Beispiel #3
0
 public static void Append(string fileName, string sheetName, DataTable dt)
 {
     WorkbookHelper.Append(fileName, sheetName, dt);
 }
Beispiel #4
0
 public static void Append(string fileName, DataSet ds)
 {
     WorkbookHelper.Append(fileName, ds);
 }