Actually the data is not importing in the custTable as I Have Info also but the result is not Okie
Code Is
Public void JamilsJob(Args _args)
{
dialog dialog;
Filename filename;
DialogField dialogFilename;
//Excel variables
SysExcelApplication application;
SysExcelWorkbooks workbooks;
SysExcelWorkbook workbook;
SysExcelWorksheets worksheets;
SysExcelWorksheet worksheet;
SysExcelCells cells;
COMVariantType type;
//Common Variables
int row;
CustTable Cust;
// str BankCentralBankPurposeText;
//str IdentificationNumber;
str CustGroupName ;
str BankAccountNumber;
dialog = new Dialog("Excel Upoad");
dialogFilename = dialog.addField(extendedTypeStr(FileNameOpen));
dialog.filenameLookupTitle("Upload from Excel");
dialog.caption("Excel Upload");
dialogFilename.value(filename);
if(!dialog.run())
return;
filename = dialogFilename.value();
application = SysExcelApplication::construct();
workbooks = application.workbooks();
try
{
workbooks.open(filename);
}
catch (Exception::Error)
{
throw error("File cannot be opened.");
}
workbook = workbooks.item(1);
worksheets = workbook.worksheets();
worksheet = worksheets.itemFromNum(1); //Here 1 is the worksheet Number
cells = worksheet.cells();
do
{
row++;
CustGroupName = cells.item(row, 1).value().bStr();
BankAccountNumber = cells.item(row, 2).value().bStr();
Cust.BankCentralBankPurposeText = CustGroupName;
Cust.IdentificationNumber = BankAccountNumber;
info(strFmt("%1 - %2 - Desc",Cust.BankCentralBankPurposeText,Cust.IdentificationNumber));
Cust.insert();
type = cells.item(row+1, 1).value().variantType();
//info(strFmt("%1 - %2 - Desc",cells.item(row, 2).value().bStr(),Cust.BankCentralBankPurposeText));
}
while (type != COMVariantType::VT_EMPTY);
application.quit();
info('Done');
}
and the Reult come after running this
Info also mot Giving me the result
CustGroupName - BankAccountNumber - Desc