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 + */ }
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; }
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); }
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); }
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"); }
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; }
public XLPivotValueStyleFormat(IXLPivotField field = null, IXLStyle style = null) : base(field, style) { }
public IXLPivotValueStyleFormat AndWith(IXLPivotField field, Predicate <Object> predicate) { FieldReferences.Add(new PivotLabelFieldReference(field, predicate)); return(this); }
public IXLPivotValueStyleFormat AndWith(IXLPivotField field) { return(AndWith(field, null)); }
public XLPivotStyleFormats(IXLPivotField pivotField) { this._pivotField = pivotField; }
public PivotLabelFieldReference(IXLPivotField pivotField, Predicate <Object> predicate) { this.PivotField = pivotField ?? throw new ArgumentNullException(nameof(pivotField)); this.predicate = predicate; }
public PivotLabelFieldReference(IXLPivotField pivotField) : this(pivotField, null) { }
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)); }
public XLPivotFieldStyleFormats(IXLPivotField field) { this.PivotField = field; }