static void ExportImportData(Args _args)
{
SysExcelApplication xlsApplication;
SysExcelWorkBooks xlsWorkBookCollection;
SysExcelWorkBook xlsWorkBook;
SysExcelWorkSheets xlsWorkSheetCollection;
SysExcelWorkSheet xlsWorkSheet;
SysExcelRange xlsRange;
ExportImportRecords exportImportRecords; //Table used to export data
int row = 1;
str fileName;
;
{
SysExcelApplication xlsApplication;
SysExcelWorkBooks xlsWorkBookCollection;
SysExcelWorkBook xlsWorkBook;
SysExcelWorkSheets xlsWorkSheetCollection;
SysExcelWorkSheet xlsWorkSheet;
SysExcelRange xlsRange;
ExportImportRecords exportImportRecords; //Table used to export data
int row = 1;
str fileName;
;
fileName = “C:\\Libraries\Documents\exportImportRecords.xlsx”;
xlsApplication = SysExcelApplication::construct();
//Create Excel WorkBook and WorkSheet
xlsWorkBookCollection = xlsApplication.workbooks();
xlsWorkBook = xlsWorkBookCollection.add();
xlsWorkSheetCollection = xlsWorkBook.worksheets();
xlsWorkSheet = xlsWorkSheetCollection.itemFromNum(1);
//Create Excel WorkBook and WorkSheet
xlsWorkBookCollection = xlsApplication.workbooks();
xlsWorkBook = xlsWorkBookCollection.add();
xlsWorkSheetCollection = xlsWorkBook.worksheets();
xlsWorkSheet = xlsWorkSheetCollection.itemFromNum(1);
xlsWorkSheet.cells().item(row,1).value(“Account Num”);
xlsWorkSheet.cells().item(row,2).value(“Name”);
xlsWorkSheet.cells().item(row,3).value(“Phone”);
row++;
xlsWorkSheet.cells().item(row,2).value(“Name”);
xlsWorkSheet.cells().item(row,3).value(“Phone”);
row++;
while select exportImportRecords
{
if(row == 10)
break;
xlsWorkSheet.cells().item(row,1).value(exportImportRecords.ID);
xlsWorkSheet.cells().item(row,2).value(exportImportRecords.Name);
xlsWorkSheet.cells().item(row,3).value(exportImportRecords.Phone);
row++;
}
{
if(row == 10)
break;
xlsWorkSheet.cells().item(row,1).value(exportImportRecords.ID);
xlsWorkSheet.cells().item(row,2).value(exportImportRecords.Name);
xlsWorkSheet.cells().item(row,3).value(exportImportRecords.Phone);
row++;
}
if(WinApi::fileExists(fileName))
WinApi::deleteFile(fileName);
WinApi::deleteFile(fileName);
xlsApplication.visible(true);
info(“Export Completed”);
}
info(“Export Completed”);
}
No comments:
Post a Comment