public int GetNextAvailableRow()
        {
            //to get next available row, we get total of all rows plus number of all reference sheets
            //multiply by two (rows between the sheets)
            var totalRows = SheetTables.Select(s => s.Rows.Count).Sum();

            if (totalRows == 0)
            {
                // completely new reference sheet no need to shift from top
                return(1 + __ROWS_BETWEEN_REFERENCE_SHEETS__);
            }

            //already rows there, need to make space for next reference table
            return(totalRows + SheetTables.Count + SheetTables.Count * __ROWS_BETWEEN_REFERENCE_SHEETS__);
        }
Ejemplo n.º 2
0
 /// <summary>
 ///     Get data table config for further customisation.
 /// </summary>
 /// <param name="sheetName">
 ///     Case sensitive, to be matched with <see cref="ISheetExportConfig.SheetName"/>
 /// </param>
 /// <returns></returns>
 public DataTableExportAutoConfig GetTableConfig(string sheetName)
 {
     return((DataTableExportAutoConfig)SheetTables.FirstOrDefault(t => t.SheetName == sheetName));
 }