Exemple #1
0
        internal SLConditionalFormatting2010 Clone()
        {
            SLConditionalFormatting2010 cf = new SLConditionalFormatting2010();

            int i;

            cf.Rules = new List <SLConditionalFormattingRule2010>();
            for (i = 0; i < this.Rules.Count; ++i)
            {
                cf.Rules.Add(this.Rules[i].Clone());
            }

            cf.ReferenceSequence = new List <SLCellPointRange>();
            SLCellPointRange cpr;

            for (i = 0; i < this.ReferenceSequence.Count; ++i)
            {
                cpr = new SLCellPointRange(this.ReferenceSequence[i].StartRowIndex, this.ReferenceSequence[i].StartColumnIndex, this.ReferenceSequence[i].EndRowIndex, this.ReferenceSequence[i].EndColumnIndex);
                cf.ReferenceSequence.Add(cpr);
            }

            cf.Pivot = this.Pivot;

            return(cf);
        }
        private void SetAllNull()
        {
            this.IsNewPivotTable   = true;
            this.DataRange         = new SLCellPointRange(-1, -1, -1, -1);
            this.IsDataSourceTable = false;
            this.SheetTableName    = string.Empty;

            // Excel 2013 uses 5 for attributes createdVersion and updatedVersion
            // and 3 for attribute minRefreshableVersion.
            // I don't know what earlier versions of Excel use because I've uninstalled
            // the earlier versions of Excel 2007 and 2010...
            // These three attributes are application dependent, which means technically they're
            // dependent on SpreadsheetLight.
            // For the sake of simplicity, I'm going to set all three attributes to the value of 3,
            // so Excel (whatever version) can handle it without being insufferable.

            this.Name         = "";
            this.CacheId      = 0;
            this.DataOnRows   = false;
            this.DataPosition = null;

            this.AutoFormatId            = null;
            this.ApplyNumberFormats      = null;
            this.ApplyBorderFormats      = null;
            this.ApplyFontFormats        = null;
            this.ApplyPatternFormats     = null;
            this.ApplyAlignmentFormats   = null;
            this.ApplyWidthHeightFormats = null;

            this.DataCaption         = "";
            this.GrandTotalCaption   = "";
            this.ErrorCaption        = "";
            this.ShowError           = false;
            this.MissingCaption      = "";
            this.ShowMissing         = true;
            this.PageStyle           = "";
            this.PivotTableStyleName = "";
            this.VacatedStyle        = "";
            this.Tag                    = "";
            this.UpdatedVersion         = 3; // supposed to default 0. See above.
            this.MinRefreshableVersion  = 3; // supposed to default 0. See above.
            this.AsteriskTotals         = false;
            this.ShowItems              = true;
            this.EditData               = false;
            this.DisableFieldList       = false;
            this.ShowCalculatedMembers  = true;
            this.VisualTotals           = true;
            this.ShowMultipleLabel      = true;
            this.ShowDataDropDown       = true;
            this.ShowDrill              = true;
            this.PrintDrill             = false;
            this.ShowMemberPropertyTips = true;
            this.ShowDataTips           = true;
            this.EnableWizard           = true;
            this.EnableDrill            = true;
            this.EnableFieldProperties  = true;
            this.PreserveFormatting     = true;
            this.UseAutoFormatting      = false;
            this.PageWrap               = 0;
            this.PageOverThenDown       = false;
            this.SubtotalHiddenItems    = false;
            this.RowGrandTotals         = true;
            this.ColumnGrandTotals      = true;
            this.FieldPrintTitles       = false;
            this.ItemPrintTitles        = false;
            this.MergeItem              = false;
            this.ShowDropZones          = true;
            this.CreatedVersion         = 3; // supposed to default 0. See above.
            this.Indent                 = 1;
            this.ShowEmptyRow           = false;
            this.ShowEmptyColumn        = false;
            this.ShowHeaders            = true;
            this.Compact                = true;
            this.Outline                = false;
            this.OutlineData            = false;
            this.CompactData            = true;
            this.Published              = false;
            this.GridDropZones          = false;
            this.StopImmersiveUi        = true;
            this.MultipleFieldFilters   = true;
            this.ChartFormat            = 0;
            this.RowHeaderCaption       = "";
            this.ColumnHeaderCaption    = "";
            this.FieldListSortAscending = false;
            this.CustomListSort         = true;
        }