internal void FromConditionalFormat(ConditionalFormat cf)
        {
            this.SetAllNull();

            if (cf.Scope != null)
            {
                this.Scope = cf.Scope.Value;
            }
            if (cf.Type != null)
            {
                this.Type = cf.Type.Value;
            }
            if (cf.Priority != null)
            {
                this.Priority = cf.Priority.Value;
            }

            SLPivotArea pa;

            using (OpenXmlReader oxr = OpenXmlReader.Create(cf))
            {
                while (oxr.Read())
                {
                    if (oxr.ElementType == typeof(PivotArea))
                    {
                        pa = new SLPivotArea();
                        pa.FromPivotArea((PivotArea)oxr.LoadCurrentElement());
                        this.PivotAreas.Add(pa);
                    }
                }
            }
        }
        internal SLPivotArea Clone()
        {
            SLPivotArea pa = new SLPivotArea();

            pa.Field       = this.Field;
            pa.Type        = this.Type;
            pa.DataOnly    = this.DataOnly;
            pa.LabelOnly   = this.LabelOnly;
            pa.GrandRow    = this.GrandRow;
            pa.GrandColumn = this.GrandColumn;
            pa.CacheIndex  = this.CacheIndex;
            pa.Outline     = this.Outline;
            pa.Offset      = this.Offset;
            pa.CollapsedLevelsAreSubtotals = this.CollapsedLevelsAreSubtotals;
            pa.Axis          = this.Axis;
            pa.FieldPosition = this.FieldPosition;

            pa.PivotAreaReferences = new List <SLPivotAreaReference>();
            foreach (SLPivotAreaReference par in this.PivotAreaReferences)
            {
                pa.PivotAreaReferences.Add(par.Clone());
            }

            return(pa);
        }
예제 #3
0
 private void SetAllNull()
 {
     this.PivotArea = new SLPivotArea();
 }