Insert an empty column in the worksheet with the given name and store the name in a string. If the given name already exists then increment it. The actual name created is returned by reference
Insert column(s) in the worksheet.
BOOL InsertCol( int nPos, LPCSTR lpcszColName, string & strColNameCreated, BOOL bUndo = FALSE )
BOOL InsertCol( int nCount, int nPos = -1, BOOL bUndo = FALSE )
True for success, otherwise FALSE
True for success, otherwise FALSE
EX1
//Output the column name of the inserted column. int Worksheet_InsertCol_Ex1() { WorksheetPage wp = Project.WorksheetPages(0); if(!wp) return -1; Worksheet wks(wp.GetName()); string strColName = "NewColumn"; string strColNameCreated; BOOL bOK = wks.InsertCol(1, strColName, strColNameCreated); // Insert an empty column at the 1st column ( 0 offset) printf("Column Name created is %s\n", strColNameCreated); return (int) bOK; }
EX2
void Worksheet_InsertCol_Ex2(int nCount = 2, int nPos = -1) { Worksheet wks = Project.ActiveLayer(); if(!wks) { out_str("please activate a worksheet"); return; } if( wks.InsertCol(nCount, nPos, TRUE) ) out_str("OK"); else out_str("Fail"); }
Worksheet::DeleteCol, Worksheet::InsertRow
origin.h