internal void FromPivotArea(PivotArea pa) { this.SetAllNull(); if (pa.Field != null) { this.Field = pa.Field.Value; } if (pa.Type != null) { this.Type = pa.Type.Value; } if (pa.DataOnly != null) { this.DataOnly = pa.DataOnly.Value; } if (pa.LabelOnly != null) { this.LabelOnly = pa.LabelOnly.Value; } if (pa.GrandRow != null) { this.GrandRow = pa.GrandRow.Value; } if (pa.GrandColumn != null) { this.GrandColumn = pa.GrandColumn.Value; } if (pa.CacheIndex != null) { this.CacheIndex = pa.CacheIndex.Value; } if (pa.Outline != null) { this.Outline = pa.Outline.Value; } if (pa.Offset != null) { this.Offset = pa.Offset.Value; } if (pa.CollapsedLevelsAreSubtotals != null) { this.CollapsedLevelsAreSubtotals = pa.CollapsedLevelsAreSubtotals.Value; } if (pa.Axis != null) { this.Axis = pa.Axis.Value; } if (pa.FieldPosition != null) { this.FieldPosition = pa.FieldPosition.Value; } SLPivotAreaReference par; using (OpenXmlReader oxr = OpenXmlReader.Create(pa)) { while (oxr.Read()) { if (oxr.ElementType == typeof(PivotAreaReference)) { par = new SLPivotAreaReference(); par.FromPivotAreaReference((PivotAreaReference)oxr.LoadCurrentElement()); this.PivotAreaReferences.Add(par); } } } }