Aspose::Cells::IAutoFilter Class Referenceabstract

Represents auto filtering for the specified worksheet. More...

Inherits Object.

Public Member Functions

virtual intrusive_ptr< Aspose::Cells::IDataSorterGetIDataSorter ()=0
 Gets the data sorter. More...
 
virtual void SetRange (Aspose::Cells::Systems::Int32 row, Aspose::Cells::Systems::Int32 startColumn, Aspose::Cells::Systems::Int32 endColumn)=0
 Sets the range to which the specified AutoFilter applies. More...
 
virtual intrusive_ptr< Aspose::Cells::ICellAreaGetICellArea ()=0
 Gets the ICellArea where the specified AutoFilter applies. More...
 
virtual intrusive_ptr< Aspose::Cells::Systems::String > GetRange ()=0
 Represents the range to which the specified AutoFilter applies. More...
 
virtual void SetRange (intrusive_ptr< Aspose::Cells::Systems::String > value)=0
 Represents the range to which the specified AutoFilter applies. More...
 
virtual void AddFilter (Aspose::Cells::Systems::Int32 fieldIndex, intrusive_ptr< Aspose::Cells::Systems::String > criteria)=0
 Adds a filter for a filter column. More...
 
virtual void AddDateFilter (Aspose::Cells::Systems::Int32 fieldIndex, Aspose::Cells::DateTimeGroupingType dateTimeGroupingType, Aspose::Cells::Systems::Int32 year, Aspose::Cells::Systems::Int32 month, Aspose::Cells::Systems::Int32 day, Aspose::Cells::Systems::Int32 hour, Aspose::Cells::Systems::Int32 minute, Aspose::Cells::Systems::Int32 second)=0
 Adds a date filter. More...
 
virtual void RemoveDateFilter (Aspose::Cells::Systems::Int32 fieldIndex, Aspose::Cells::DateTimeGroupingType dateTimeGroupingType, Aspose::Cells::Systems::Int32 year, Aspose::Cells::Systems::Int32 month, Aspose::Cells::Systems::Int32 day, Aspose::Cells::Systems::Int32 hour, Aspose::Cells::Systems::Int32 minute, Aspose::Cells::Systems::Int32 second)=0
 Removes a date filter. More...
 
virtual void RemoveFilter (Aspose::Cells::Systems::Int32 fieldIndex, intrusive_ptr< Aspose::Cells::Systems::String > criteria)=0
 Removes a filter for a filter column. More...
 
virtual void Filter (Aspose::Cells::Systems::Int32 fieldIndex, intrusive_ptr< Aspose::Cells::Systems::String > criteria)=0
 Filters a list with specified criteria. More...
 
virtual void FilterTop10 (Aspose::Cells::Systems::Int32 fieldIndex, bool isTop, bool isPercent, Aspose::Cells::Systems::Int32 itemCount)=0
 Filter the top 10 item in the list More...
 
virtual void DynamicFilter (Aspose::Cells::Systems::Int32 fieldIndex, Aspose::Cells::DynamicFilterType dynamicFilterType)=0
 Adds a dynamic filter. More...
 
virtual void AddFontColorFilter (Aspose::Cells::Systems::Int32 fieldIndex, intrusive_ptr< Aspose::Cells::ICellsColor > color)=0
 Adds a font color filter. More...
 
virtual void AddFillColorFilter (Aspose::Cells::Systems::Int32 fieldIndex, Aspose::Cells::BackgroundType pattern, intrusive_ptr< Aspose::Cells::ICellsColor > foregroundColor, intrusive_ptr< Aspose::Cells::ICellsColor > backgroundColor)=0
 Adds a fill color filter. More...
 
virtual void AddIconFilter (Aspose::Cells::Systems::Int32 fieldIndex, Aspose::Cells::IconSetType iconSetType, Aspose::Cells::Systems::Int32 iconId)=0
 Adds an icon filter. More...
 
virtual void MatchBlanks (Aspose::Cells::Systems::Int32 fieldIndex)=0
 Match all blank cell in the list. More...
 
virtual void MatchNonBlanks (Aspose::Cells::Systems::Int32 fieldIndex)=0
 Match all not blank cell in the list. More...
 
virtual void Custom (Aspose::Cells::Systems::Int32 fieldIndex, Aspose::Cells::FilterOperatorType operatorType1, intrusive_ptr< Aspose::Cells::Systems::Object > criteria1)=0
 Filters a list with a custom criteria. More...
 
virtual void Custom (Aspose::Cells::Systems::Int32 fieldIndex, Aspose::Cells::FilterOperatorType operatorType1, intrusive_ptr< Aspose::Cells::Systems::Object > criteria1, bool isAnd, Aspose::Cells::FilterOperatorType operatorType2, intrusive_ptr< Aspose::Cells::Systems::Object > criteria2)=0
 Filters a list with custom criteria. More...
 
virtual void ShowAll ()=0
 Unhide all rows. More...
 
virtual void RemoveFilter (Aspose::Cells::Systems::Int32 fieldIndex)=0
 Remove the specific filter. More...
 
virtual intrusive_ptr< Aspose::Cells::Systems::Array1D< Aspose::Cells::Systems::Int32 > > Refresh ()=0
 Refresh auto filters to hide or unhide the rows. More...
 
virtual intrusive_ptr< Aspose::Cells::Systems::Array1D< Aspose::Cells::Systems::Int32 > > Refresh (bool hideRows)=0
 Gets all hidden rows' indexes. More...
 
virtual bool GetShowFilterButton ()=0
 Indicates whether the AutoFilter button for this column is visible. More...
 
virtual void SetShowFilterButton (bool value)=0
 Indicates whether the AutoFilter button for this column is visible. More...
 
virtual intrusive_ptr< Aspose::Cells::IFilterColumnCollectionGetIFilterColumns ()=0
 Gets the collection of the filter columns. More...
 

Detailed Description

Represents auto filtering for the specified worksheet.

[C++]//Creating a file stream containing the Excel file to be opened
intrusive_ptr<FileStream> fstream = new FileStream(new String("D:\\book1.xls"), FileMode::FileMode_Open);
//Instantiating a Workbook object and open a stream.
intrusive_ptr<IWorkbook> workbook = Factory::CreateIWorkbook(fstream);
//Accessing the first worksheet in the Excel file
intrusive_ptr<IWorksheet> worksheet = workbook->GetIWorksheets()->GetObjectByIndex(0);
//Creating AutoFilter by giving the cells range of the heading row
worksheet->GetIAutoFilter()->SetRange(new String("A1:B1"));
//Filtering columns with specified values
worksheet->GetIAutoFilter()->Filter(1, new String("Bananas"));
//Saving the modified Excel file.
workbook->Save(new String("D:\\output.xls"));
//Closing the file stream to free all resources
fstream->Close();
<br>

Member Function Documentation

◆ AddDateFilter()

virtual void Aspose::Cells::IAutoFilter::AddDateFilter ( Aspose::Cells::Systems::Int32  fieldIndex,
Aspose::Cells::DateTimeGroupingType  dateTimeGroupingType,
Aspose::Cells::Systems::Int32  year,
Aspose::Cells::Systems::Int32  month,
Aspose::Cells::Systems::Int32  day,
Aspose::Cells::Systems::Int32  hour,
Aspose::Cells::Systems::Int32  minute,
Aspose::Cells::Systems::Int32  second 
)
pure virtual

Adds a date filter.

Parameters
fieldIndexThe integer offset of the field on which you want to base the filter (from the left of the list; the leftmost field is field 0).
dateTimeGroupingTypeDateTimeGroupingType
yearThe year.
monthThe month.
dayThe day.
hourThe hour.
minuteThe minute.
secondThe second.

If DateTimeGroupingType is Year, only the param year effects. If DateTiemGroupingType is Month, only the param year and month effect.

◆ AddFillColorFilter()

virtual void Aspose::Cells::IAutoFilter::AddFillColorFilter ( Aspose::Cells::Systems::Int32  fieldIndex,
Aspose::Cells::BackgroundType  pattern,
intrusive_ptr< Aspose::Cells::ICellsColor foregroundColor,
intrusive_ptr< Aspose::Cells::ICellsColor backgroundColor 
)
pure virtual

Adds a fill color filter.

Parameters
fieldIndexThe integer offset of the field on which you want to base the filter (from the left of the list; the leftmost field is field 0).
patternThe background pattern type.
foregroundColorThe foreground color.
backgroundColorThe background color.

◆ AddFilter()

virtual void Aspose::Cells::IAutoFilter::AddFilter ( Aspose::Cells::Systems::Int32  fieldIndex,
intrusive_ptr< Aspose::Cells::Systems::String >  criteria 
)
pure virtual

Adds a filter for a filter column.

Parameters
fieldIndexThe integer offset of the field on which you want to base the filter (from the left of the list; the leftmost field is field 0).
criteriaThe specified criteria (a string; for example, "101"). It only can be null or be one of the cells' value in this column.

MS Excel 2007 supports multiple selection in a filter column.

◆ AddFontColorFilter()

virtual void Aspose::Cells::IAutoFilter::AddFontColorFilter ( Aspose::Cells::Systems::Int32  fieldIndex,
intrusive_ptr< Aspose::Cells::ICellsColor color 
)
pure virtual

Adds a font color filter.

Parameters
fieldIndexThe integer offset of the field on which you want to base the filter (from the left of the list; the leftmost field is field 0).
colorThe ICellsColor object.

◆ AddIconFilter()

virtual void Aspose::Cells::IAutoFilter::AddIconFilter ( Aspose::Cells::Systems::Int32  fieldIndex,
Aspose::Cells::IconSetType  iconSetType,
Aspose::Cells::Systems::Int32  iconId 
)
pure virtual

Adds an icon filter.

Parameters
fieldIndexThe integer offset of the field on which you want to base the filter (from the left of the list; the leftmost field is field 0).
iconSetTypeThe icon set type.
iconIdThe icon id.

Only supports to add the icon filter. Not supports checking which row is visible if the filter is icon filter.

◆ Custom() [1/2]

virtual void Aspose::Cells::IAutoFilter::Custom ( Aspose::Cells::Systems::Int32  fieldIndex,
Aspose::Cells::FilterOperatorType  operatorType1,
intrusive_ptr< Aspose::Cells::Systems::Object >  criteria1 
)
pure virtual

Filters a list with a custom criteria.

Parameters
fieldIndexThe integer offset of the field on which you want to base the filter (from the left of the list; the leftmost field is field 0).
operatorType1The filter operator type
criteria1The custom criteria

◆ Custom() [2/2]

virtual void Aspose::Cells::IAutoFilter::Custom ( Aspose::Cells::Systems::Int32  fieldIndex,
Aspose::Cells::FilterOperatorType  operatorType1,
intrusive_ptr< Aspose::Cells::Systems::Object >  criteria1,
bool  isAnd,
Aspose::Cells::FilterOperatorType  operatorType2,
intrusive_ptr< Aspose::Cells::Systems::Object >  criteria2 
)
pure virtual

Filters a list with custom criteria.

Parameters
fieldIndexThe integer offset of the field on which you want to base the filter (from the left of the list; the leftmost field is field 0).
operatorType1The filter operator type
criteria1The custom criteria
isAnd
operatorType2The filter operator type
criteria2The custom criteria

◆ DynamicFilter()

virtual void Aspose::Cells::IAutoFilter::DynamicFilter ( Aspose::Cells::Systems::Int32  fieldIndex,
Aspose::Cells::DynamicFilterType  dynamicFilterType 
)
pure virtual

Adds a dynamic filter.

Parameters
fieldIndexThe integer offset of the field on which you want to base the filter (from the left of the list; the leftmost field is field 0).
dynamicFilterTypeDynamic filter type.

◆ Filter()

virtual void Aspose::Cells::IAutoFilter::Filter ( Aspose::Cells::Systems::Int32  fieldIndex,
intrusive_ptr< Aspose::Cells::Systems::String >  criteria 
)
pure virtual

Filters a list with specified criteria.

Parameters
fieldIndexThe integer offset of the field on which you want to base the filter (from the left of the list; the leftmost field is field 0).
criteriaThe specified criteria (a string; for example, "101").

Aspose.Cells will remove all other filter setting on this field as Ms Excel 97-2003.

◆ FilterTop10()

virtual void Aspose::Cells::IAutoFilter::FilterTop10 ( Aspose::Cells::Systems::Int32  fieldIndex,
bool  isTop,
bool  isPercent,
Aspose::Cells::Systems::Int32  itemCount 
)
pure virtual

Filter the top 10 item in the list

Parameters
fieldIndexThe integer offset of the field on which you want to base the filter (from the left of the list; the leftmost field is field 0).
isTopIndicates whether filter from top or bottom
isPercentIndicates whether the items is percent or count
itemCountThe item count

◆ GetICellArea()

virtual intrusive_ptr<Aspose::Cells::ICellArea> Aspose::Cells::IAutoFilter::GetICellArea ( )
pure virtual

Gets the ICellArea where the specified AutoFilter applies.

Returns

◆ GetIDataSorter()

virtual intrusive_ptr<Aspose::Cells::IDataSorter> Aspose::Cells::IAutoFilter::GetIDataSorter ( )
pure virtual

Gets the data sorter.

◆ GetIFilterColumns()

virtual intrusive_ptr<Aspose::Cells::IFilterColumnCollection> Aspose::Cells::IAutoFilter::GetIFilterColumns ( )
pure virtual

Gets the collection of the filter columns.

◆ GetRange()

virtual intrusive_ptr<Aspose::Cells::Systems::String> Aspose::Cells::IAutoFilter::GetRange ( )
pure virtual

Represents the range to which the specified AutoFilter applies.

◆ GetShowFilterButton()

virtual bool Aspose::Cells::IAutoFilter::GetShowFilterButton ( )
pure virtual

Indicates whether the AutoFilter button for this column is visible.

◆ MatchBlanks()

virtual void Aspose::Cells::IAutoFilter::MatchBlanks ( Aspose::Cells::Systems::Int32  fieldIndex)
pure virtual

Match all blank cell in the list.

Parameters
fieldIndexThe integer offset of the field on which you want to base the filter (from the left of the list; the leftmost field is field 0).

◆ MatchNonBlanks()

virtual void Aspose::Cells::IAutoFilter::MatchNonBlanks ( Aspose::Cells::Systems::Int32  fieldIndex)
pure virtual

Match all not blank cell in the list.

Parameters
fieldIndexThe integer offset of the field on which you want to base the filter (from the left of the list; the leftmost field is field 0).

◆ Refresh() [1/2]

virtual intrusive_ptr<Aspose::Cells::Systems::Array1D<Aspose::Cells::Systems::Int32> > Aspose::Cells::IAutoFilter::Refresh ( )
pure virtual

Refresh auto filters to hide or unhide the rows.

Returns
Returns all hidden rows' indexes.

◆ Refresh() [2/2]

virtual intrusive_ptr<Aspose::Cells::Systems::Array1D<Aspose::Cells::Systems::Int32> > Aspose::Cells::IAutoFilter::Refresh ( bool  hideRows)
pure virtual

Gets all hidden rows' indexes.

Parameters
hideRowsIf true, hide the filtered rows.
Returns
Returns all hidden rows indexes.

◆ RemoveDateFilter()

virtual void Aspose::Cells::IAutoFilter::RemoveDateFilter ( Aspose::Cells::Systems::Int32  fieldIndex,
Aspose::Cells::DateTimeGroupingType  dateTimeGroupingType,
Aspose::Cells::Systems::Int32  year,
Aspose::Cells::Systems::Int32  month,
Aspose::Cells::Systems::Int32  day,
Aspose::Cells::Systems::Int32  hour,
Aspose::Cells::Systems::Int32  minute,
Aspose::Cells::Systems::Int32  second 
)
pure virtual

Removes a date filter.

Parameters
fieldIndexThe integer offset of the field on which you want to base the filter (from the left of the list; the leftmost field is field 0).
dateTimeGroupingTypeDateTimeGroupingType
yearThe year.
monthThe month.
dayThe day.
hourThe hour.
minuteThe minute.
secondThe second.

If DateTimeGroupingType is Year, only the param year effects. If DateTiemGroupingType is Month, only the param year and month effect.

◆ RemoveFilter() [1/2]

virtual void Aspose::Cells::IAutoFilter::RemoveFilter ( Aspose::Cells::Systems::Int32  fieldIndex,
intrusive_ptr< Aspose::Cells::Systems::String >  criteria 
)
pure virtual

Removes a filter for a filter column.

Parameters
fieldIndexThe integer offset of the field on which you want to base the filter (from the left of the list; the leftmost field is field 0).
criteriaThe specified criteria (a string; for example, "101"). It only can be null or be one of the cells' value in this column.

◆ RemoveFilter() [2/2]

virtual void Aspose::Cells::IAutoFilter::RemoveFilter ( Aspose::Cells::Systems::Int32  fieldIndex)
pure virtual

Remove the specific filter.

Parameters
fieldIndexThe specific filter index

◆ SetRange() [1/2]

virtual void Aspose::Cells::IAutoFilter::SetRange ( Aspose::Cells::Systems::Int32  row,
Aspose::Cells::Systems::Int32  startColumn,
Aspose::Cells::Systems::Int32  endColumn 
)
pure virtual

Sets the range to which the specified AutoFilter applies.

Parameters
rowRow index.
startColumnStart column index.
endColumnEnd column Index.

◆ SetRange() [2/2]

virtual void Aspose::Cells::IAutoFilter::SetRange ( intrusive_ptr< Aspose::Cells::Systems::String >  value)
pure virtual

Represents the range to which the specified AutoFilter applies.

◆ SetShowFilterButton()

virtual void Aspose::Cells::IAutoFilter::SetShowFilterButton ( bool  value)
pure virtual

Indicates whether the AutoFilter button for this column is visible.

◆ ShowAll()

virtual void Aspose::Cells::IAutoFilter::ShowAll ( )
pure virtual

Unhide all rows.