Пример #1
0
        private void CreateHeader(ExcelDoc excel)
        {
            int i = 1;

            foreach (DataColumn column in _dt.Columns)
            {
                excel.setValue(1, i, column.ColumnName);

                i++;
            }
        }
Пример #2
0
        private void CreateBody(ExcelDoc excel)
        {
            int i = 2;

            foreach (DataRow row in _dt.Rows)
            {
                for (int j = 0; j < row.ItemArray.Count(); j++ )
                {
                    if (row.ItemArray[j].ToString() == string.Empty)
                        continue;

                    excel.setValue(i, (j + 1), row.ItemArray[j].ToString());
                }

                i++;
            }
        }