Remarks put a group of values into a row in worksheet
BOOL SetCells( const vector<string> & vsValues, int nRow = -1, int nC1 = 0, BOOL bConsiderNumeric = true, DWORD dwCtrl = 0 )
BOOL SetCells( const vector& vdValues, int nRow = -1, int nC1 = 0, DWORD dwCtrl = 0 );
WKSSETCELLS_UNDO : undo WKSSETCELLS_BY_COL: set cell values into a column instead of a row WKSSETCELLS_TREAT_DASH_AS_TEXT : - and -- will be considered as text
TRUE for success, otherwise return false.
EX1
//Remarks put a group of values into a row in worksheet. void Worksheet_SetCells_Ex1() { WorksheetPage wp = Project.WorksheetPages(0); if(!wp) return; Worksheet wks(wp.GetName()); vector<string> vsValues; for(int ii = 0; ii < 10; ii++) { vsValues.Add(ftoa(ii)); } if( wks.SetCells(vsValues) ) printf("Success to set worksheet cell values!"); else printf("Fail to set cell values!"); }
EX2
void wks_SetCells_lastrow() { Worksheet wks = Project.ActiveLayer(); if(!wks) return; int nRow = -1; int nCol = 0; DWORD dwCtrl = 0; vector vdValues = {0.0, 1.2, NANUM, 4}; wks.SetCells(vdValues, nRow, nCol, dwCtrl); }
origin.h