예제 #1
0
        /// <summary>
        /// Create Worksheet with the provided data.
        ///
        /// Will use the Object Property Names as Column Headers (First Row) and then populate the cells with data.
        /// You can use <see cref="XlsxColumnAttribute"/> and <see cref="XlsxIgnoreColumnAttribute"/> to control the output.
        /// </summary>
        /// <param name="sheetName">The name of the Sheet</param>
        /// <param name="data">The data, can be empty or null</param>
        /// <param name="cacheTypeColumns">If true, the Column info for the given type is being cached in memory</param>
        public static Worksheet FromData <T>(string sheetName, IEnumerable <T> data, bool cacheTypeColumns = false) where T : class
        {
            var sheet = new Worksheet(sheetName);

            sheet.Populate(data, cacheTypeColumns);
            return(sheet);
        }
예제 #2
0
        public static Worksheet FromData <T>(string sheetName, IEnumerable <T> data) where T : class
        {
            var sheet = new Worksheet(sheetName);

            sheet.Populate(data);
            return(sheet);
        }