Namespace EasyXLS.PivotTables
Class ExcelField
System.Object
EasyXLS.PivotTables.ExcelField
- Direct Known Subclasses:
ExcelCalculatedField
public class ExcelField
extends System.Object
This class stores pivot table field information like name, area location, subtotals & filters options, layout & print options and sort order.
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionvoid
addSubtotal(int subtotal)
Adds a subtotal for the pivot table field.Clone()
Creates and returns a copy of this object.int
getArea()
Returns the area location of the pivot table field.System.String
If the field is part of a group, returns the base field.System.String
Returns the name of the pivot table field.System.String
If the field is part of a group, returns the group by option.System.String
If the field is part of a group, returns the end value for a group.double
If the field is part of a group, returns the group interval.System.String
If the field is part of a group, returns the start value for a group.System.String
Returns the field number format.System.String
Returns the original name of source range column.int
Returns the sort order of the field data.int
getSubtotalAt(int index)
Returns the subtotal from the specified index.void
groupBy(bool autoStartAt, bool autoEndAt, System.String startAt, System.String endAt, System.String groupBy, System.String baseField, double groupInterval)
Internal use onlybool
Returns true if any new items in the pivot table having a filter are included, false otherwise.bool
Returns true if the group end value is automatic, false otherwise.bool
Returns true if the group start value is automatic, false otherwise.bool
Returns true if a blank line is inserted after each item label, false otherwise.bool
Returns true if a blank line is inserted after each item, false otherwise.void
removeSubtotal(int index)
Removes the subtotal from the specified index.void
setCustomName(System.String customName)
Sets the name of the pivot table field.void
setInsertBlankLine(bool insertBlankLine)
Sets if a blank line is inserted after each item label.void
setInsertPageBreak(bool insertPageBreak)
Sets if a blank line is inserted after each item.void
setNewItemsInFilter(bool include)
Sets if any new items in the pivot table having a filter are included.void
setNumberFormat(System.String numberFormat)
Sets the field number format.void
setOriginalName(System.String name)
Sets the original name of the pivot table field.void
setShowItemLabelsInOutlineForm(bool show, bool compact, bool subtotalsOnTop)
Sets if the field items are displayed in outline form.void
setShowItemLabelsInTabularForm(bool show)
Sets if the field items are displayed in tabular form.void
setShowItemsWithNoData(bool show)
Sets if the items with no data are displayed.void
setSortOrder(int sortOrder)
Sets the sort order of the field data.bool
Returns true if the labels from the next field in the same column or compact form are displayed, false otherwise.bool
Returns true if the field items are displayed in outline form, false if the field items are displayed in tabular form.bool
Returns true if the field items are displayed in tabular form, false if the field items are displayed in outline form.bool
Returns true if the items with no data are displayed, false otherwise.bool
Returns true if the subtotals at the top of each group are displayed, false otherwise.int
Returns the number of subtotals for the pivot table field.Methods inherited from class System.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Constructor Details
-
ExcelField
public ExcelField()Defines an instance of the pivot table field.
-
-
Method Details
-
setCustomName
public void setCustomName(System.String customName)Sets the name of the pivot table field.- Parameters:
customName
- the name of the pivot table field- See Also:
getCustomName()
-
getCustomName
public System.String getCustomName()Returns the name of the pivot table field.- Returns:
- the name of the pivot table field
- See Also:
setCustomName(System.String)
,getOriginalName()
-
setOriginalName
public void setOriginalName(System.String name)Sets the original name of the pivot table field.- Parameters:
name
- the original name of the pivot table field- See Also:
getOriginalName()
-
getOriginalName
public System.String getOriginalName()Returns the original name of source range column.- Returns:
- the original name of source range column
- See Also:
setCustomName(System.String)
,getCustomName()
-
getArea
public int getArea()Returns the area location of the pivot table field.- Returns:
- the area location of the pivot table field. Possible values are available in
PivotTable
class. - See Also:
ExcelPivotTable.addFieldToRowLabels(System.String)
,ExcelPivotTable.addFieldToColumnLabels(System.String)
,ExcelPivotTable.addFieldToReportFilter(System.String)
-
addSubtotal
public void addSubtotal(int subtotal)Adds a subtotal for the pivot table field.- Parameters:
subtotal
- - the subtotal to be added. Possible values are available inPivotTable
class.- See Also:
removeSubtotal(int)
,getSubtotalAt(int)
,SubtotalCount()
-
removeSubtotal
public void removeSubtotal(int index)Removes the subtotal from the specified index.- Parameters:
index
- the subtotal index- See Also:
addSubtotal(int)
,getSubtotalAt(int)
,SubtotalCount()
-
getSubtotalAt
public int getSubtotalAt(int index)Returns the subtotal from the specified index.- Parameters:
index
- the subtotal index- Returns:
- the subtotal with the specified index. Possible values are available in
PivotTable
class. - See Also:
addSubtotal(int)
,removeSubtotal(int)
,SubtotalCount()
-
SubtotalCount
public int SubtotalCount()Returns the number of subtotals for the pivot table field.- Returns:
- the number of subtotals for the pivot table field
- See Also:
addSubtotal(int)
,removeSubtotal(int)
,getSubtotalAt(int)
-
HasNewItemsInFilter
public bool HasNewItemsInFilter()Returns true if any new items in the pivot table having a filter are included, false otherwise.- Returns:
- true if any new items in the pivot table having a filter are included, false otherwise
- See Also:
setNewItemsInFilter(bool)
-
setNewItemsInFilter
public void setNewItemsInFilter(bool include)Sets if any new items in the pivot table having a filter are included.- Parameters:
include
- true if any new items in the pivot table having a filter are included, false otherwise- See Also:
HasNewItemsInFilter()
-
ShowItemLabelsInOutlineForm
public bool ShowItemLabelsInOutlineForm()Returns true if the field items are displayed in outline form, false if the field items are displayed in tabular form.- Returns:
- true if the field items are displayed in outline form, false if the field items are displayed in tabular form
- See Also:
setShowItemLabelsInOutlineForm(bool, bool, bool)
,ShowCompactForm()
,ShowSubtotalsOnTop()
,setShowItemLabelsInTabularForm(bool)
,ShowItemLabelsInTabularForm()
-
ShowCompactForm
public bool ShowCompactForm()Returns true if the labels from the next field in the same column or compact form are displayed, false otherwise.- Returns:
- true if the labels from the next field in the same column or compact form are displayed, false otherwise
- See Also:
setShowItemLabelsInOutlineForm(bool, bool, bool)
,ShowItemLabelsInOutlineForm()
,ShowSubtotalsOnTop()
,setShowItemLabelsInTabularForm(bool)
,ShowItemLabelsInTabularForm()
-
ShowSubtotalsOnTop
public bool ShowSubtotalsOnTop()Returns true if the subtotals at the top of each group are displayed, false otherwise.- Returns:
- true if the subtotals at the top of each group are displayed, false otherwise
- See Also:
setShowItemLabelsInOutlineForm(bool, bool, bool)
,ShowItemLabelsInOutlineForm()
,ShowCompactForm()
,setShowItemLabelsInTabularForm(bool)
,ShowItemLabelsInTabularForm()
-
setShowItemLabelsInOutlineForm
public void setShowItemLabelsInOutlineForm(bool show, bool compact, bool subtotalsOnTop)Sets if the field items are displayed in outline form.- Parameters:
show
- true if the field items are displayed in outline form, false otherwisecompact
- true if the labels from the next field in the same column or compact form are displayed, false otherwisesubtotalsOnTop
- true if the subtotals at the top of each group are displayed, false otherwise- See Also:
ShowItemLabelsInOutlineForm()
,ShowCompactForm()
,ShowSubtotalsOnTop()
,setShowItemLabelsInTabularForm(bool)
,ShowItemLabelsInTabularForm()
-
ShowItemLabelsInTabularForm
public bool ShowItemLabelsInTabularForm()Returns true if the field items are displayed in tabular form, false if the field items are displayed in outline form.- Returns:
- true if the field items are displayed in tabular form, false if the field items are displayed in outline form
- See Also:
setShowItemLabelsInTabularForm(bool)
,setShowItemLabelsInOutlineForm(bool, bool, bool)
,ShowItemLabelsInOutlineForm()
-
setShowItemLabelsInTabularForm
public void setShowItemLabelsInTabularForm(bool show)Sets if the field items are displayed in tabular form.- Parameters:
show
- true if the field items are displayed in tabular form, false otherwise- See Also:
ShowItemLabelsInTabularForm()
,setShowItemLabelsInOutlineForm(bool, bool, bool)
,ShowItemLabelsInOutlineForm()
-
IsInsertBlankLine
public bool IsInsertBlankLine()Returns true if a blank line is inserted after each item label, false otherwise.- Returns:
- true if a blank line is inserted after each item label, false otherwise
- See Also:
setInsertBlankLine(bool)
-
setInsertBlankLine
public void setInsertBlankLine(bool insertBlankLine)Sets if a blank line is inserted after each item label.- Parameters:
insertBlankLine
- true if a blank line is inserted after each item label, false otherwise- See Also:
IsInsertBlankLine()
-
ShowItemsWithNoData
public bool ShowItemsWithNoData()Returns true if the items with no data are displayed, false otherwise.- Returns:
- true if the items with no data are displayed, false otherwise
- See Also:
setShowItemsWithNoData(bool)
-
setShowItemsWithNoData
public void setShowItemsWithNoData(bool show)Sets if the items with no data are displayed.- Parameters:
show
- true if the items with no data are displayed, false otherwise- See Also:
ShowItemsWithNoData()
-
IsInsertPageBreak
public bool IsInsertPageBreak()Returns true if a blank line is inserted after each item, false otherwise.- Returns:
- true if a blank line is inserted after each item, false otherwise
- See Also:
setInsertPageBreak(bool)
-
setInsertPageBreak
public void setInsertPageBreak(bool insertPageBreak)Sets if a blank line is inserted after each item.- Parameters:
insertPageBreak
- true if a blank line is inserted after each item, false otherwise- See Also:
IsInsertPageBreak()
-
getSortOrder
public int getSortOrder()Returns the sort order of the field data. Possible values are available inPivotTable
class.- Returns:
- the sort order of the field data
- See Also:
setSortOrder(int)
-
setSortOrder
public void setSortOrder(int sortOrder)Sets the sort order of the field data.- Parameters:
sortOrder
- the sort order. Possible values are available inPivotTable
class.- See Also:
getSortOrder()
-
groupBy
public void groupBy(bool autoStartAt, bool autoEndAt, System.String startAt, System.String endAt, System.String groupBy, System.String baseField, double groupInterval)Internal use only- Parameters:
autoStartAt
- true if the group start value is automatic, false otherwiseautoEndAt
- true if the group end value is automatic, false otherwisestartAt
- start value for the groupendAt
- end value for the groupgroupBy
- the group by optionbaseField
- the base fieldgroupInterval
- the group interval
-
getGroupBy
public System.String getGroupBy()If the field is part of a group, returns the group by option.- Returns:
- the group by option
- See Also:
ExcelPivotTable.groupNumericField(System.String, bool, double, bool, double, double)
,ExcelPivotTable.groupDateField(System.String, bool, System.DateTime, bool, System.DateTime, bool, bool, bool, bool, int, bool, bool, bool)
,getBaseField()
,getGroupInterval()
,IsGroupAutoStart()
,IsGroupAutoEnd()
,getGroupStartAt()
,getGroupEndAt()
-
getBaseField
public System.String getBaseField()If the field is part of a group, returns the base field.- Returns:
- the base field
- See Also:
ExcelPivotTable.groupNumericField(System.String, bool, double, bool, double, double)
,ExcelPivotTable.groupDateField(System.String, bool, System.DateTime, bool, System.DateTime, bool, bool, bool, bool, int, bool, bool, bool)
,getGroupBy()
,getGroupInterval()
,IsGroupAutoStart()
,IsGroupAutoEnd()
,getGroupStartAt()
,getGroupEndAt()
-
getGroupInterval
public double getGroupInterval()If the field is part of a group, returns the group interval. It is valid only for numeric fields and a group by days field.- Returns:
- the group interval
- See Also:
ExcelPivotTable.groupNumericField(System.String, bool, double, bool, double, double)
,ExcelPivotTable.groupDateField(System.String, bool, System.DateTime, bool, System.DateTime, bool, bool, bool, bool, int, bool, bool, bool)
,getGroupBy()
,getBaseField()
,IsGroupAutoStart()
,IsGroupAutoEnd()
,getGroupStartAt()
,getGroupEndAt()
-
IsGroupAutoStart
public bool IsGroupAutoStart()Returns true if the group start value is automatic, false otherwise.- Returns:
- true if the group start value is automatic, false otherwise
- See Also:
ExcelPivotTable.groupNumericField(System.String, bool, double, bool, double, double)
,ExcelPivotTable.groupDateField(System.String, bool, System.DateTime, bool, System.DateTime, bool, bool, bool, bool, int, bool, bool, bool)
,IsGroupAutoEnd()
,getGroupStartAt()
,getGroupEndAt()
,getGroupBy()
,getBaseField()
,getGroupInterval()
-
IsGroupAutoEnd
public bool IsGroupAutoEnd()Returns true if the group end value is automatic, false otherwise.- Returns:
- true if the group end value is automatic, false otherwise
- See Also:
ExcelPivotTable.groupNumericField(System.String, bool, double, bool, double, double)
,ExcelPivotTable.groupDateField(System.String, bool, System.DateTime, bool, System.DateTime, bool, bool, bool, bool, int, bool, bool, bool)
,IsGroupAutoStart()
,getGroupStartAt()
,getGroupEndAt()
,getGroupBy()
,getBaseField()
,getGroupInterval()
-
getGroupStartAt
public System.String getGroupStartAt()If the field is part of a group, returns the start value for a group.- Returns:
- the start value for a group
- See Also:
ExcelPivotTable.groupNumericField(System.String, bool, double, bool, double, double)
,ExcelPivotTable.groupDateField(System.String, bool, System.DateTime, bool, System.DateTime, bool, bool, bool, bool, int, bool, bool, bool)
,IsGroupAutoStart()
,IsGroupAutoEnd()
,getGroupEndAt()
,getGroupBy()
,getBaseField()
,getGroupInterval()
-
getGroupEndAt
public System.String getGroupEndAt()If the field is part of a group, returns the end value for a group.- Returns:
- the end value for a group
- See Also:
ExcelPivotTable.groupNumericField(System.String, bool, double, bool, double, double)
,ExcelPivotTable.groupDateField(System.String, bool, System.DateTime, bool, System.DateTime, bool, bool, bool, bool, int, bool, bool, bool)
,IsGroupAutoStart()
,IsGroupAutoEnd()
,getGroupStartAt()
,getGroupBy()
,getBaseField()
,getGroupInterval()
-
getNumberFormat
public System.String getNumberFormat()Returns the field number format. Possible values are available inFormat
class.- Returns:
- the field number format
- See Also:
setNumberFormat(System.String)
-
setNumberFormat
public void setNumberFormat(System.String numberFormat)Sets the field number format. Possible values are available inFormat
class.- Parameters:
numberFormat
- the field number format- See Also:
getNumberFormat()
-
Clone
Creates and returns a copy of this object.- Returns:
- a clone of this instance.
-