Reorder
Reorder the rows of worksheet with specified orders
BOOL Reorder( const vector<uint> & vnOrder, int nC1 = 0, int nC2 = -1, BOOL bUndo = FALSE )
true if success, otherwise false
EX1
//Reorder the rows of worksheet with specified orders. void Worksheet_Reorder_ex1() { //fill columns with row number and run this code to see the result Worksheet wks = Project.ActiveLayer(); if ( wks ) { //this code apply to each column, reorder the first 6 items, and fill the rest with the first item int nC1 = 0, nC2 = -1; //all columns vector<uint> vnOrder = {1, 3, 5, 2, 4, 0}; vnOrder.SetSize(32); //resize, default the other items except the first 6 are filled with 0. BOOL bRet = wks.Reorder(vnOrder, nC1, nC2); if ( bRet ) out_str("Reorder successfully executed!"); } }
origin.h