attach a Worksheet object by [Book]Sheet specification. Create if not found
bool attach_or_create_sheet( Datasheet & wks, LPCSTR lpcszBookSheetName, int nCreate = CREATE_HIDDEN, bool bMatrixSheet = false )
true for attach success or create success; otherwise false
EX1
//Befor run this example, make a datasheet (Matrixlayer or Worksheet) active in the project. void attach_or_create_sheet_ex() { Datasheet dsDa; string strPage = Project.ActiveLayer().GetPage().GetName(); if(attach_or_create_sheet( dsDa, strPage)) out_str("attach_success!"); Datasheet dsDb; strPage = "[Book7]";//assume book7 doesn't exist. if(attach_or_create_sheet( dsDb, strPage,CREATE_HIDDEN,true)) out_str("Create and attach a booksheet"); }
origin.h