Popular Posts

Tuesday, 5 July 2011

Excel creation through x++

Excel Creation Through X++
static void ExportingFields4mCustTable(Args _args)
{
    CustTable CustTableLocal;
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 CustTableLocal
{
excelCells.item(i+4,4).value(cellValue.bStr(CustTableLocal.AccountNum));
excelCells.item(i+4,5).value(cellValue.bStr(CustTableLocal.Name));
i++;
}
excelApp.visible(true);

}

No comments:

Post a Comment