예제 #1
0
            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);
                    }
                }
            }
예제 #2
0
            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);
                    }
                }
            }