Ejemplo n.º 1
0
        private void BuildFormatting(PivotTag pivotTag, FieldPivotTag tag, IXLPivotField pf)
        {
            foreach (var func in tag.SubtotalFunction)
            {
                pf.AddSubtotal(func);
            }

            // TODO pivot field formatting

            /*
             * '    Rem Build page fields' + vbCR +
             * '    For i = 1 To PageFieldsCount' + vbCR +
             * '      V = Pages(i)' + vbCR +
             * '      Set PF = PT.PivotFields(V(2))' + vbCR +
             * '      PF.Subtotals = V(3)' + vbCR +
             * '      If Args(14) = True Then' + vbCR +
             * '          Set FmtRange = SrcRange.Cells(2, V(1) - 1)' + vbCR +
             * '          If (PF.DataType = xlDate) Or (PF.DataType = xlNumber) Then' + vbCR +
             * '            PF.NumberFormat = FmtRange.NumberFormat' + vbCR +
             * '          End If' + vbCR +
             * '          PF.DataRange.Interior.ColorIndex = FmtRange.Interior.ColorIndex' + vbCR +
             * '          PF.DataRange.Font.Name = FmtRange.Font.Name' + vbCR +
             * '          PF.DataRange.Font.Color = FmtRange.Font.Color' + vbCR +
             * '          PF.DataRange.Font.Size = FmtRange.Font.Size' + vbCR +
             * '          PF.DataRange.Font.FontStyle = FmtRange.Font.FontStyle' + vbCR +
             * '          PF.DataRange.HorizontalAlignment = FmtRange.HorizontalAlignment' + vbCR +
             * '          PF.DataRange.VerticalAlignment = FmtRange.VerticalAlignment' + vbCR +
             * '      End If' + vbCR +
             * '    Next' + vbCR +
             */
        }
Ejemplo n.º 2
0
 public int IndexOf(IXLPivotField pf)
 {
     var selectedItem = _pivotFields.Select((item, index) => new {Item = item, Position = index}).FirstOrDefault(i => i.Item.Key == pf.SourceName);
     if (selectedItem == null)
         throw new IndexOutOfRangeException("Invalid field name.");
     return selectedItem.Position;
 }
Ejemplo n.º 3
0
        public int IndexOf(IXLPivotField pf)
        {
            var selectedItem = _pivotFields.Select((item, index) => new { Item = item, Position = index }).FirstOrDefault(i => i.Item.Key == pf.SourceName);

            if (selectedItem == null)
            {
                throw new IndexOutOfRangeException("Invalid field name.");
            }
            return(selectedItem.Position);
        }
Ejemplo n.º 4
0
        public Int32 IndexOf(IXLPivotField pf)
        {
            var selectedItem = _pivotFields.Select((item, index) => new { Item = item, Position = index }).FirstOrDefault(i => i.Item.Key == pf.SourceName);

            if (selectedItem == null)
            {
                throw new ArgumentNullException(nameof(pf), "Invalid field name.");
            }

            return(selectedItem.Position);
        }
Ejemplo n.º 5
0
 private static void AssertFieldOptions(IXLPivotField field, bool withDefaults)
 {
     Assert.AreEqual(!withDefaults, field.SubtotalsAtTop, "SubtotalsAtTop save failure");
     Assert.AreEqual(!withDefaults, field.ShowBlankItems, "ShowBlankItems save failure");
     Assert.AreEqual(!withDefaults, field.Outline, "Outline save failure");
     Assert.AreEqual(!withDefaults, field.Compact, "Compact save failure");
     Assert.AreEqual(withDefaults, field.Collapsed, "Collapsed save failure");
     Assert.AreEqual(withDefaults, field.InsertBlankLines, "InsertBlankLines save failure");
     Assert.AreEqual(withDefaults, field.RepeatItemLabels, "RepeatItemLabels save failure");
     Assert.AreEqual(withDefaults, field.InsertPageBreaks, "InsertPageBreaks save failure");
     Assert.AreEqual(withDefaults, field.IncludeNewItemsInFilter, "IncludeNewItemsInFilter save failure");
 }
Ejemplo n.º 6
0
 private static void SetFieldOptions(IXLPivotField field, bool withDefaults)
 {
     field.SubtotalsAtTop          = !withDefaults;
     field.ShowBlankItems          = !withDefaults;
     field.Outline                 = !withDefaults;
     field.Compact                 = !withDefaults;
     field.Collapsed               = withDefaults;
     field.InsertBlankLines        = withDefaults;
     field.RepeatItemLabels        = withDefaults;
     field.InsertPageBreaks        = withDefaults;
     field.IncludeNewItemsInFilter = withDefaults;
 }
Ejemplo n.º 7
0
 public XLPivotValueStyleFormat(IXLPivotField field = null, IXLStyle style = null)
     : base(field, style)
 {
 }
Ejemplo n.º 8
0
 public IXLPivotValueStyleFormat AndWith(IXLPivotField field, Predicate <Object> predicate)
 {
     FieldReferences.Add(new PivotLabelFieldReference(field, predicate));
     return(this);
 }
Ejemplo n.º 9
0
 public IXLPivotValueStyleFormat AndWith(IXLPivotField field)
 {
     return(AndWith(field, null));
 }
 public XLPivotStyleFormats(IXLPivotField pivotField)
 {
     this._pivotField = pivotField;
 }
Ejemplo n.º 11
0
 public PivotLabelFieldReference(IXLPivotField pivotField, Predicate <Object> predicate)
 {
     this.PivotField = pivotField ?? throw new ArgumentNullException(nameof(pivotField));
     this.predicate  = predicate;
 }
Ejemplo n.º 12
0
 public PivotLabelFieldReference(IXLPivotField pivotField)
     : this(pivotField, null)
 {
 }
Ejemplo n.º 13
0
 public XLPivotStyleFormat(IXLPivotField field = null, IXLStyle style = null)
 {
     PivotField = field;
     Style      = style ?? XLStyle.Default;
 }
 public Int32 IndexOf(IXLPivotField pf)
 {
     return(IndexOf(pf.SourceName));
 }
 public bool Contains(IXLPivotField pivotField)
 {
     return(_pivotFields.ContainsKey(pivotField.SourceName));
 }
Ejemplo n.º 16
0
 public XLPivotFieldStyleFormats(IXLPivotField field)
 {
     this.PivotField = field;
 }