// CREATE BY TYO
static void New_EY_importCSP_ItemList(Args _args)
{
SysExcelApplication application;
SysExcelWorkbooks workbooks;
SysExcelWorkbook workbook;
SysExcelWorksheets worksheets;
SysExcelWorksheet worksheet;
SysExcelCells cells;
SysExcelCell cell;
COMVariantType type;
int row;
CSP_ItemList CSP_ItemList;
Itemid itemid;
Filename fileName = "D:\\Tectura\\bisa.xlsx";
application = SysExcelApplication::construct();
workbooks = application.workbooks();
try
{
workbooks.open(fileName);
}
catch (Exception::Error)
{
throw error(strfmt('File: "%1" cannot be opened.', fileName));
}
workbook = workbooks.item(1);
worksheets = workbook.worksheets();
worksheet = worksheets.itemFromNum(1);
cells = worksheet.cells();
row = 2;
type = cells.item(row, 1).value().variantType();
while (type != COMVariantType::VT_EMPTY)
{
CSP_ItemList.clear();
ItemId = cells.item(row, 1).value().bStr(); // Itemid
CSP_ItemList.ItemId = ItemId; // itemid
info("Selesai");
if (itemid!="")
CSP_ItemList.insert();
row++;
type = cells.item(row, 1).value().variantType();
}
application.quit();
}
// CREATE BY TYO
static void New_EY_importCSP_ItemList(Args _args)
{
SysExcelApplication application;
SysExcelWorkbooks workbooks;
SysExcelWorkbook workbook;
SysExcelWorksheets worksheets;
SysExcelWorksheet worksheet;
SysExcelCells cells;
SysExcelCell cell;
COMVariantType type;
int row;
CSP_ItemList CSP_ItemList;
Itemid itemid;
Filename fileName = "D:\\Tectura\\bisa.xlsx";
application = SysExcelApplication::construct();
workbooks = application.workbooks();
try
{
workbooks.open(fileName);
}
catch (Exception::Error)
{
throw error(strfmt('File: "%1" cannot be opened.', fileName));
}
workbook = workbooks.item(1);
worksheets = workbook.worksheets();
worksheet = worksheets.itemFromNum(1);
cells = worksheet.cells();
row = 2;
type = cells.item(row, 1).value().variantType();
while (type != COMVariantType::VT_EMPTY)
{
CSP_ItemList.clear();
ItemId = cells.item(row, 1).value().bStr(); // Itemid
CSP_ItemList.ItemId = ItemId; // itemid
info("Selesai");
if (itemid!="")
CSP_ItemList.insert();
row++;
type = cells.item(row, 1).value().variantType();
}
application.quit();
}
// CREATE BY TYO
0 comments:
Post a Comment