Aspose::Cells::IDataSorter Class Referenceabstract

Summary description for DataSorter. More...

Inherits Object.

Public Member Functions

virtual void Clear ()=0
 Clear all settings. More...
 
virtual bool HasHeaders ()=0
 Represents whether the range has headers. More...
 
virtual void SetHasHeaders (bool value)=0
 Represents whether the range has headers. More...
 
virtual void AddKey (Aspose::Cells::Systems::Int32 key, Aspose::Cells::SortOrder order)=0
 Adds sorted column index and sort order. More...
 
virtual void AddKey (Aspose::Cells::Systems::Int32 key, Aspose::Cells::SortOrder order, intrusive_ptr< Aspose::Cells::Systems::String > customList)=0
 Adds sorted column index and sort order with custom sort list. More...
 
virtual void AddKey (Aspose::Cells::Systems::Int32 key, Aspose::Cells::SortOnType type, Aspose::Cells::SortOrder order, intrusive_ptr< Aspose::Cells::Systems::Object > customList)=0
 Adds sorted column index and sort order with custom sort list. More...
 
virtual void AddKey (Aspose::Cells::Systems::Int32 key, Aspose::Cells::SortOrder order, intrusive_ptr< Aspose::Cells::Systems::Array1D< Aspose::Cells::Systems::String *>> customList)=0
 Adds sorted column index and sort order with custom sort list. More...
 
virtual Aspose::Cells::Systems::Int32 GetKey1 ()=0
 Represents first sorted column index(absolute position, column A is 0, B is 1, ...). More...
 
virtual void SetKey1 (Aspose::Cells::Systems::Int32 value)=0
 Represents first sorted column index(absolute position, column A is 0, B is 1, ...). More...
 
virtual Aspose::Cells::SortOrder GetOrder1 ()=0
 Represents sort order of the first key. More...
 
virtual void SetOrder1 (Aspose::Cells::SortOrder value)=0
 Represents sort order of the first key. More...
 
virtual Aspose::Cells::Systems::Int32 GetKey2 ()=0
 Represents second sorted column index(absolute position, column A is 0, B is 1, ...). More...
 
virtual void SetKey2 (Aspose::Cells::Systems::Int32 value)=0
 Represents second sorted column index(absolute position, column A is 0, B is 1, ...). More...
 
virtual Aspose::Cells::SortOrder GetOrder2 ()=0
 Represents sort order of the second key. More...
 
virtual void SetOrder2 (Aspose::Cells::SortOrder value)=0
 Represents sort order of the second key. More...
 
virtual Aspose::Cells::Systems::Int32 GetKey3 ()=0
 Represents third sorted column index(absolute position, column A is 0, B is 1, ...). More...
 
virtual void SetKey3 (Aspose::Cells::Systems::Int32 value)=0
 Represents third sorted column index(absolute position, column A is 0, B is 1, ...). More...
 
virtual Aspose::Cells::SortOrder GetOrder3 ()=0
 Represents sort order of the third key. More...
 
virtual void SetOrder3 (Aspose::Cells::SortOrder value)=0
 Represents sort order of the third key. More...
 
virtual bool GetSortLeftToRight ()=0
 True means that sorting orientation is from left to right. False means that sorting orientation is from top to bottom. The default value is false. More...
 
virtual void SetSortLeftToRight (bool value)=0
 True means that sorting orientation is from left to right. False means that sorting orientation is from top to bottom. The default value is false. More...
 
virtual bool GetCaseSensitive ()=0
 Gets and sets whether case sensitive when comparing string. More...
 
virtual void SetCaseSensitive (bool value)=0
 Gets and sets whether case sensitive when comparing string. More...
 
virtual bool GetSortAsNumber ()=0
 Indicates whether sorting anything that looks like a number. More...
 
virtual void SetSortAsNumber (bool value)=0
 Indicates whether sorting anything that looks like a number. More...
 
virtual intrusive_ptr< Aspose::Cells::Systems::Array1D< Aspose::Cells::Systems::Int32 > > Sort (intrusive_ptr< Aspose::Cells::ICells > cells, Aspose::Cells::Systems::Int32 startRow, Aspose::Cells::Systems::Int32 startColumn, Aspose::Cells::Systems::Int32 endRow, Aspose::Cells::Systems::Int32 endColumn)=0
 Sorts the data of the area. More...
 
virtual intrusive_ptr< Aspose::Cells::Systems::Array1D< Aspose::Cells::Systems::Int32 > > Sort (intrusive_ptr< Aspose::Cells::ICells > cells, intrusive_ptr< Aspose::Cells::ICellArea > area)=0
 Sort the data of the area. More...
 
virtual intrusive_ptr< Aspose::Cells::Systems::Array1D< Aspose::Cells::Systems::Int32 > > Sort ()=0
 Sort the data in the range. More...
 

Detailed Description

Summary description for DataSorter.

[C++]
//You need to create a right Workbook to test.
intrusive_ptr<IWorkbook> workbook = Factory::CreateIWorkbook(new String("D:\\Book1.xls"));
//Get the workbook datasorter object.
intrusive_ptr<IDataSorter> sorter = workbook->GetIDataSorter();
//Set the first order for datasorter object.
sorter->SetOrder1(SortOrder_Descending);
//Define the first key.
sorter->SetKey1(0);
//Set the second order for datasorter object.
sorter->SetOrder2(SortOrder_Ascending);
//Define the second key.
sorter->SetKey2(1);
//Create a cells area (range).
intrusive_ptr<ICellArea> ca = Factory::CreateICellArea();
//Specify the start row index.
ca->SetstartRow(0);
//Specify the start column index.
ca->SetstartColumn(0);
//Specify the last row index.
ca->SetendRow(13);
//Specify the last column index.
ca->SetendColumn(1);
//Sort data in the specified data range (A1:B14)
sorter->Sort(workbook->GetIWorksheets()->GetObjectByIndex(0)->GetICells(), ca);
//Save the excel file.
workbook->Save(new String("D:\\outBook.xls"));

Member Function Documentation

◆ AddKey() [1/4]

virtual void Aspose::Cells::IDataSorter::AddKey ( Aspose::Cells::Systems::Int32  key,
Aspose::Cells::SortOrder  order 
)
pure virtual

Adds sorted column index and sort order.

Parameters
keyThe sorted column index(absolute position, column A is 0, B is 1, ...)
orderThe sort order

◆ AddKey() [2/4]

virtual void Aspose::Cells::IDataSorter::AddKey ( Aspose::Cells::Systems::Int32  key,
Aspose::Cells::SortOrder  order,
intrusive_ptr< Aspose::Cells::Systems::String >  customList 
)
pure virtual

Adds sorted column index and sort order with custom sort list.

Parameters
keyThe sorted column index(absolute position, column A is 0, B is 1, ...)
orderThe sort order.
customListThe custom sort list.

◆ AddKey() [3/4]

virtual void Aspose::Cells::IDataSorter::AddKey ( Aspose::Cells::Systems::Int32  key,
Aspose::Cells::SortOnType  type,
Aspose::Cells::SortOrder  order,
intrusive_ptr< Aspose::Cells::Systems::Object >  customList 
)
pure virtual

Adds sorted column index and sort order with custom sort list.

Parameters
keyThe sorted column index(absolute position, column A is 0, B is 1, ...)
typeThe sorted value type.
orderThe sort order.
customListThe custom sort list.

If type is SortOnType.CellColor or SortOnType.FontColor, the customList is Color.

◆ AddKey() [4/4]

virtual void Aspose::Cells::IDataSorter::AddKey ( Aspose::Cells::Systems::Int32  key,
Aspose::Cells::SortOrder  order,
intrusive_ptr< Aspose::Cells::Systems::Array1D< Aspose::Cells::Systems::String *>>  customList 
)
pure virtual

Adds sorted column index and sort order with custom sort list.

Parameters
keyThe sorted column index(absolute position, column A is 0, B is 1, ...)
orderThe sort order.
customListThe custom sort list.

◆ Clear()

virtual void Aspose::Cells::IDataSorter::Clear ( )
pure virtual

Clear all settings.

◆ GetCaseSensitive()

virtual bool Aspose::Cells::IDataSorter::GetCaseSensitive ( )
pure virtual

Gets and sets whether case sensitive when comparing string.

◆ GetKey1()

virtual Aspose::Cells::Systems::Int32 Aspose::Cells::IDataSorter::GetKey1 ( )
pure virtual

Represents first sorted column index(absolute position, column A is 0, B is 1, ...).

◆ GetKey2()

virtual Aspose::Cells::Systems::Int32 Aspose::Cells::IDataSorter::GetKey2 ( )
pure virtual

Represents second sorted column index(absolute position, column A is 0, B is 1, ...).

◆ GetKey3()

virtual Aspose::Cells::Systems::Int32 Aspose::Cells::IDataSorter::GetKey3 ( )
pure virtual

Represents third sorted column index(absolute position, column A is 0, B is 1, ...).

◆ GetOrder1()

virtual Aspose::Cells::SortOrder Aspose::Cells::IDataSorter::GetOrder1 ( )
pure virtual

Represents sort order of the first key.

◆ GetOrder2()

virtual Aspose::Cells::SortOrder Aspose::Cells::IDataSorter::GetOrder2 ( )
pure virtual

Represents sort order of the second key.

◆ GetOrder3()

virtual Aspose::Cells::SortOrder Aspose::Cells::IDataSorter::GetOrder3 ( )
pure virtual

Represents sort order of the third key.

◆ GetSortAsNumber()

virtual bool Aspose::Cells::IDataSorter::GetSortAsNumber ( )
pure virtual

Indicates whether sorting anything that looks like a number.

◆ GetSortLeftToRight()

virtual bool Aspose::Cells::IDataSorter::GetSortLeftToRight ( )
pure virtual

True means that sorting orientation is from left to right. False means that sorting orientation is from top to bottom. The default value is false.

◆ HasHeaders()

virtual bool Aspose::Cells::IDataSorter::HasHeaders ( )
pure virtual

Represents whether the range has headers.

◆ SetCaseSensitive()

virtual void Aspose::Cells::IDataSorter::SetCaseSensitive ( bool  value)
pure virtual

Gets and sets whether case sensitive when comparing string.

◆ SetHasHeaders()

virtual void Aspose::Cells::IDataSorter::SetHasHeaders ( bool  value)
pure virtual

Represents whether the range has headers.

◆ SetKey1()

virtual void Aspose::Cells::IDataSorter::SetKey1 ( Aspose::Cells::Systems::Int32  value)
pure virtual

Represents first sorted column index(absolute position, column A is 0, B is 1, ...).

◆ SetKey2()

virtual void Aspose::Cells::IDataSorter::SetKey2 ( Aspose::Cells::Systems::Int32  value)
pure virtual

Represents second sorted column index(absolute position, column A is 0, B is 1, ...).

◆ SetKey3()

virtual void Aspose::Cells::IDataSorter::SetKey3 ( Aspose::Cells::Systems::Int32  value)
pure virtual

Represents third sorted column index(absolute position, column A is 0, B is 1, ...).

◆ SetOrder1()

virtual void Aspose::Cells::IDataSorter::SetOrder1 ( Aspose::Cells::SortOrder  value)
pure virtual

Represents sort order of the first key.

◆ SetOrder2()

virtual void Aspose::Cells::IDataSorter::SetOrder2 ( Aspose::Cells::SortOrder  value)
pure virtual

Represents sort order of the second key.

◆ SetOrder3()

virtual void Aspose::Cells::IDataSorter::SetOrder3 ( Aspose::Cells::SortOrder  value)
pure virtual

Represents sort order of the third key.

◆ SetSortAsNumber()

virtual void Aspose::Cells::IDataSorter::SetSortAsNumber ( bool  value)
pure virtual

Indicates whether sorting anything that looks like a number.

◆ SetSortLeftToRight()

virtual void Aspose::Cells::IDataSorter::SetSortLeftToRight ( bool  value)
pure virtual

True means that sorting orientation is from left to right. False means that sorting orientation is from top to bottom. The default value is false.

◆ Sort() [1/3]

virtual intrusive_ptr<Aspose::Cells::Systems::Array1D<Aspose::Cells::Systems::Int32> > Aspose::Cells::IDataSorter::Sort ( intrusive_ptr< Aspose::Cells::ICells cells,
Aspose::Cells::Systems::Int32  startRow,
Aspose::Cells::Systems::Int32  startColumn,
Aspose::Cells::Systems::Int32  endRow,
Aspose::Cells::Systems::Int32  endColumn 
)
pure virtual

Sorts the data of the area.

Parameters
cellsThe cells contains the data area.
startRowThe start row of the area.
startColumnThe start column of the area.
endRowThe end row of the area.
endColumnThe end column of the area.
Returns
the original indices(absolute position, for example, column A is 0, B is 1, ...) of the sorted rows/columns. If no rows/columns needs to be moved by this sorting operation, null will be returned.

◆ Sort() [2/3]

virtual intrusive_ptr<Aspose::Cells::Systems::Array1D<Aspose::Cells::Systems::Int32> > Aspose::Cells::IDataSorter::Sort ( intrusive_ptr< Aspose::Cells::ICells cells,
intrusive_ptr< Aspose::Cells::ICellArea area 
)
pure virtual

Sort the data of the area.

Parameters
cellsThe cells contains the data area.
areaThe area needed to sort
Returns
the original indices(absolute position, for example, column A is 0, B is 1, ...) of the sorted rows/columns. If no rows/columns needs to be moved by this sorting operation, null will be returned.

◆ Sort() [3/3]

virtual intrusive_ptr<Aspose::Cells::Systems::Array1D<Aspose::Cells::Systems::Int32> > Aspose::Cells::IDataSorter::Sort ( )
pure virtual

Sort the data in the range.

Returns
the original indices(absolute position, for example, column A is 0, B is 1, ...) of the sorted rows/columns. If no rows/columns needs to be moved by this sorting operation, null will be returned.