public static IEnumerable <Dimension> Enumerate(XlsxPivotReader w) { var multiTable = w.MultiTableWorkbook; var sheet = w.GetWorksheetIfExists(SheetNaming.PivotHorizontal); if (sheet != null) { var r = 0; foreach (var d in sheet.Entities <Dimension>()) { d.Rank = r++; d.Orientation = Dimension.Orientations.Horizontal; yield return(d); } } sheet = w.GetWorksheetIfExists(SheetNaming.PivotVertical); if (sheet != null) { var r = 0; foreach (var d in sheet.Entities <Dimension>()) { d.Rank = r++; d.Orientation = Dimension.Orientations.Vertical; yield return(d); } } }
public static IEnumerable <Dimension> Enumerate(XlsxPivotReader w, string tableName) { var multiTable = w.MultiTableWorkbook; var sheet = w.GetWorksheetIfExists(SheetNaming.PivotHorizontal); if (sheet != null) { var r = 0; foreach (var d in sheet.Entities <Dimension>()) { if (multiTable) { if (!tableName.Equals(d.Sheet, System.StringComparison.OrdinalIgnoreCase)) { continue; } } d.Rank = r++; d.Orientation = Dimension.Orientations.Horizontal; yield return(d); } } sheet = w.GetWorksheetIfExists(SheetNaming.PivotVertical); if (sheet != null) { var r = 0; foreach (var d in sheet.Entities <Dimension>()) { if (multiTable) { if (!tableName.Equals(d.Sheet, System.StringComparison.OrdinalIgnoreCase)) { continue; } } d.Rank = r++; d.Orientation = Dimension.Orientations.Vertical; yield return(d); } } }