2.2.4.46.94 Worksheet::StackColumnsByDesignation


Description

This function stack columns by plot designation. Each column designation is unique in each combination.When there is a missing column in front/middle of the combination, repeat the column from last combination. Note:disregardful columns would be ignore

Syntax

BOOL StackColumnsByDesignation( Worksheet& wksDest, const vector<uint>& vnColIndices )

Parameters

wksDest
[Modified] The Worksheet where the stacked data is copied onto,it must be valid otherwise do nothing.
vnColIndices
[input] column indices to be stack in worksheet

Return

Returns true on successful exit and false on error.

Examples

EX1

// This example stack all columns in worksheet1 by rule above and output result to worksheet2.
void Worksheet_StackColumnsByDesignation_Ex1()
{
	Worksheet worksheet1 = Project.ActiveLayer();
	const int nNumCols = 5;
	worksheet1.SetSize( -1, nNumCols );
	worksheet1.SetColDesignations( "XYZYZ" );
	Worksheet worksheet2;
	worksheet2.Create("origin");
	//here fill data to worksheet
	for( int ii = 0; ii < nNumCols; ii++ )
	{
		Dataset ds(worksheet1, ii);
		ds.SetSize( nNumCols );
		ds.Data( ii, ii + nNumCols, 1);
	}
	
	vector<uint> vnIndices;
	vnIndices.Data( 0, nNumCols, 1);
	bool bRet = worksheet1.StackColumnsByDesignation( worksheet2, vnIndices);
	string strMsg;
	strMsg = bRet ? "Function succeed" : "Function failed";
	out_str( strMsg );
}

Remark

See Also

Header to Include

origin.h