Ejemplo n.º 1
0
        public static void Append(this IWorkbook workbook, string sheetName, DataTable dt)
        {
            ISheet sheet = workbook.GetSheet(sheetName);

            if (sheet == null || dt == null)
            {
                return;
            }

            sheet.AppendRows(dt);
        }
Ejemplo n.º 2
0
        public static void Append(this IWorkbook workbook, DataSet ds)
        {
            for (int i = 0; i < workbook.NumberOfSheets; i++)
            {
                ISheet sheet = workbook.GetSheetAt(i);

                if (i < ds.Tables.Count)
                {
                    sheet.AppendRows(ds.Tables[i]);
                }
            }
        }