// Generates content of pivotTableCacheDefinitionPart1.
        private void GeneratePivotTableCacheDefinitionPart1Content(PivotTableCacheDefinitionPart pivotTableCacheDefinitionPart1)
        {
            PivotCacheDefinition pivotCacheDefinition1 = new PivotCacheDefinition() { Id = "rId1", RefreshedBy = "Author", RefreshedDate = 40905.65532824074D, CreatedVersion = 4, RefreshedVersion = 4, MinRefreshableVersion = 3, RecordCount = (UInt32Value)3U };

            CacheSource cacheSource1 = new CacheSource() { Type = SourceValues.Worksheet };
            WorksheetSource worksheetSource1 = new WorksheetSource() { Reference = "A1:B4", Sheet = "Sheet2" };

            cacheSource1.Append(worksheetSource1);

            CacheFields cacheFields1 = new CacheFields() { Count = (UInt32Value)2U };

            CacheField cacheField1 = new CacheField() { Name = "id", NumberFormatId = (UInt32Value)0U };

            SharedItems sharedItems1 = new SharedItems() { ContainsSemiMixedTypes = false, ContainsString = false, ContainsNumber = true, ContainsInteger = true, MinValue = 1D, MaxValue = 3D, Count = (UInt32Value)3U };
            NumberItem numberItem1 = new NumberItem() { Val = 1D };
            NumberItem numberItem2 = new NumberItem() { Val = 2D };
            NumberItem numberItem3 = new NumberItem() { Val = 3D };

            sharedItems1.Append(numberItem1);
            sharedItems1.Append(numberItem2);
            sharedItems1.Append(numberItem3);

            cacheField1.Append(sharedItems1);

            CacheField cacheField2 = new CacheField() { Name = "score", NumberFormatId = (UInt32Value)0U };
            SharedItems sharedItems2 = new SharedItems() { ContainsSemiMixedTypes = false, ContainsString = false, ContainsNumber = true, ContainsInteger = true, MinValue = 100D, MaxValue = 132D };

            cacheField2.Append(sharedItems2);

            cacheFields1.Append(cacheField1);
            cacheFields1.Append(cacheField2);

            PivotCacheDefinitionExtensionList pivotCacheDefinitionExtensionList1 = new PivotCacheDefinitionExtensionList();

            pivotCacheDefinition1.Append(cacheSource1);
            pivotCacheDefinition1.Append(cacheFields1);
            pivotCacheDefinition1.Append(pivotCacheDefinitionExtensionList1);

            pivotTableCacheDefinitionPart1.PivotCacheDefinition = pivotCacheDefinition1;
        }
Ejemplo n.º 2
0
        internal CacheField ToCacheField()
        {
            CacheField cf = new CacheField();

            cf.Name = this.Name;
            if (this.Caption != null && this.Caption.Length > 0)
            {
                cf.Caption = this.Caption;
            }
            if (this.PropertyName != null & this.PropertyName.Length > 0)
            {
                cf.PropertyName = this.PropertyName;
            }
            if (this.ServerField != false)
            {
                cf.ServerField = this.ServerField;
            }
            if (this.UniqueList != true)
            {
                cf.UniqueList = this.UniqueList;
            }
            if (this.NumberFormatId != null)
            {
                cf.NumberFormatId = this.NumberFormatId.Value;
            }
            if (this.Formula != null && this.Formula.Length > 0)
            {
                cf.Formula = this.Formula;
            }
            if (this.SqlType != 0)
            {
                cf.SqlType = this.SqlType;
            }
            if (this.Hierarchy != 0)
            {
                cf.Hierarchy = this.Hierarchy;
            }
            if (this.Level != 0)
            {
                cf.Level = this.Level;
            }
            if (this.DatabaseField != true)
            {
                cf.DatabaseField = this.DatabaseField;
            }
            if (this.MappingCount != null)
            {
                cf.MappingCount = this.MappingCount.Value;
            }
            if (this.MemberPropertyField != false)
            {
                cf.MemberPropertyField = this.MemberPropertyField;
            }

            if (this.HasSharedItems)
            {
                cf.SharedItems = this.SharedItems.ToSharedItems();
            }

            if (this.HasFieldGroup)
            {
                cf.FieldGroup = this.FieldGroup.ToFieldGroup();
            }

            foreach (int i in this.MemberPropertiesMaps)
            {
                if (i != 0)
                {
                    cf.Append(new MemberPropertiesMap()
                    {
                        Val = i
                    });
                }
                else
                {
                    cf.Append(new MemberPropertiesMap());
                }
            }

            return(cf);
        }
Ejemplo n.º 3
0
        internal CacheField ToCacheField()
        {
            CacheField cf = new CacheField();
            cf.Name = this.Name;
            if (this.Caption != null && this.Caption.Length > 0) cf.Caption = this.Caption;
            if (this.PropertyName != null & this.PropertyName.Length > 0) cf.PropertyName = this.PropertyName;
            if (this.ServerField != false) cf.ServerField = this.ServerField;
            if (this.UniqueList != true) cf.UniqueList = this.UniqueList;
            if (this.NumberFormatId != null) cf.NumberFormatId = this.NumberFormatId.Value;
            if (this.Formula != null && this.Formula.Length > 0) cf.Formula = this.Formula;
            if (this.SqlType != 0) cf.SqlType = this.SqlType;
            if (this.Hierarchy != 0) cf.Hierarchy = this.Hierarchy;
            if (this.Level != 0) cf.Level = this.Level;
            if (this.DatabaseField != true) cf.DatabaseField = this.DatabaseField;
            if (this.MappingCount != null) cf.MappingCount = this.MappingCount.Value;
            if (this.MemberPropertyField != false) cf.MemberPropertyField = this.MemberPropertyField;

            if (this.HasSharedItems)
            {
                cf.SharedItems = this.SharedItems.ToSharedItems();
            }

            if (this.HasFieldGroup)
            {
                cf.FieldGroup = this.FieldGroup.ToFieldGroup();
            }

            foreach (int i in this.MemberPropertiesMaps)
            {
                if (i != 0) cf.Append(new MemberPropertiesMap() { Val = i });
                else cf.Append(new MemberPropertiesMap());
            }

            return cf;
        }
        internal CacheField ToCacheField()
        {
            var cf = new CacheField();

            cf.Name = Name;
            if ((Caption != null) && (Caption.Length > 0))
            {
                cf.Caption = Caption;
            }
            if ((PropertyName != null) & (PropertyName.Length > 0))
            {
                cf.PropertyName = PropertyName;
            }
            if (ServerField)
            {
                cf.ServerField = ServerField;
            }
            if (UniqueList != true)
            {
                cf.UniqueList = UniqueList;
            }
            if (NumberFormatId != null)
            {
                cf.NumberFormatId = NumberFormatId.Value;
            }
            if ((Formula != null) && (Formula.Length > 0))
            {
                cf.Formula = Formula;
            }
            if (SqlType != 0)
            {
                cf.SqlType = SqlType;
            }
            if (Hierarchy != 0)
            {
                cf.Hierarchy = Hierarchy;
            }
            if (Level != 0)
            {
                cf.Level = Level;
            }
            if (DatabaseField != true)
            {
                cf.DatabaseField = DatabaseField;
            }
            if (MappingCount != null)
            {
                cf.MappingCount = MappingCount.Value;
            }
            if (MemberPropertyField)
            {
                cf.MemberPropertyField = MemberPropertyField;
            }

            if (HasSharedItems)
            {
                cf.SharedItems = SharedItems.ToSharedItems();
            }

            if (HasFieldGroup)
            {
                cf.FieldGroup = FieldGroup.ToFieldGroup();
            }

            foreach (var i in MemberPropertiesMaps)
            {
                if (i != 0)
                {
                    cf.Append(new MemberPropertiesMap {
                        Val = i
                    });
                }
                else
                {
                    cf.Append(new MemberPropertiesMap());
                }
            }

            return(cf);
        }