output result from tree to worksheet.
int out_tree_to_wks( const TreeNode & tr, Worksheet & wks )
int out_tree_to_wks( const TreeNode & tr, LPCSTR lpcszBookName, DWORD dwCtrl = CREATE_VISIBLE | CREATE_LOAD_1ST_LAYER_ONLY )
returns row index that tree data were added
EX1
void out_tree_to_wks_ex1() { Tree tr; tr.from.dVal = 1.0; tr.to.dVal = 10.0; tr.size.nVal = 10; WorksheetPage wksPage; wksPage.Create(); Worksheet wks = wksPage.Layers(); // put result from tree to newly created worksheet int nRow = out_tree_to_wks(tr, wks); if(nRow >= 0) printf("Output to worksheet successfully, and row from %d\n", nRow); // append result from tree to existed worksheet nRow = out_tree_to_wks(tr, wks); if(nRow >= 0) printf("Output to worksheet successfully, and row from %d\n", nRow); //please check worksheet, there are two rows with the same results. }
EX2
void out_tree_to_wks_ex2(string strBookName) { Worksheet wks(strBookName); if(!wks) return; Tree tr; tr.from.dVal = 1.0; tr.to.dVal = 10.0; tr.size.nVal = 10; out_tree_to_wks(tr, wks); }
origin.h