static void exporttoExcel(Args _args)
{
#Excel
HWND HWND;
SysExcelApplication excel;
SysExcelWorkbooks books;
SysExcelWorkbook book;
SysExcelWorksheets sheets;
SysExcelWorksheet sheet;
SysExcelRange columns;
SysExcelRange column;
SysExcelCells cells;
SysExcelCell cell;
SysExcelStyle ExcelStyle;
SysExcelFont ExcelFont;
SysExcelFormatCondition FormatCondition;
inventtable IT;
int i = 0,j = 0,k=0;
excel = SysExcelApplication::construct();
books = excel.workbooks();
book = books.add();
Sheets = book.worksheets();
sheet = sheets.itemFromNum(1);
sheet.name('InventTable');
while select IT
{
K++;
excel.visible(true);
sheet.cells().item(1,1).value('ItemID');
sheet.cells().item(1,2).value('ItemName');
sheet.cells().item(1,3).value('ItemAlias');
sheet.cells().item(k,1).value(IT.ItemId);
sheet.cells().item(k,2).value(it.itemName);
sheet.cells().item(k,3).value(it.NameAlias);
if(k==10) break;
}
sheet = sheets.itemFromNum(2);
sheet.name('InventTable2');
k=1;
while select IT
{
K++;
sheet.cells().item(1,1).value('ItemID');
sheet.cells().item(1,2).value('ItemName');
sheet.cells().item(1,3).value('ItemAlias');
sheet.cells().item(k,1).value(IT.ItemId);
sheet.cells().item(k,2).value(it.itemName);
sheet.cells().item(k,3).value(it.NameAlias);
if(k==10) break;
}
}