O autor deste código usou a tabela EmplTable e exportou os campos EmplId e Name, você pode extender usando o código abaixo!

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
static void ArijitExcel(Args _args)
{
  EmplTable EmplTableLocal;
  SysExcelApplication excelApp;
  SysExcelWorkSheet excelWorksheet;
  SysExcelRange excelRange;
  SysExcelCells excelCells;
  SysExcelCell excelCell;
  ComVariant cellValue;
  Int i=1;
  ;
  excelApp = SysExcelApplication::construct();
  cellValue = new ComVariant() ;
  excelApp.workbooks().add();
  excelWorksheet = excelApp.worksheets().itemFromNum( 1 );
  excelCells = excelWorksheet.cells();
  while select * from EmplTableLocal
  {
    excelCells.item(i+4,4).value(cellValue.bStr(EmplTableLocal.EmplId));
    excelCells.item(i+4,5).value(cellValue.bStr(EmplTableLocal.Name));
    i++;
  }
  excelApp.visible(true);
  //excelApp.quit();
}

Post original.