public static void AddTableColumnHeader(IEnumerable <PropertyInfo> properties, TableFactory table) { table.AddRow(); foreach (var headerCell in properties) { var headerText = ((ExportableColumnHeaderNameAttribute)headerCell.GetCustomAttributes(typeof(ExportableColumnHeaderNameAttribute), false).FirstOrDefault()).Description; var styleProperty = ((ExportableColumnHeaderStyleAttribute)headerCell.GetCustomAttributes(typeof(ExportableColumnHeaderStyleAttribute), false).FirstOrDefault()); table.AddColumnTextHeader(headerText, styleProperty != null ? styleProperty.Styles : new string[] { }); } table.EndRow(); }