Thanx lot Steeve for your quick answers..
I ll try soon and i think that they ll resolve my problems.

As i try to advance, i meet some new difficulties, normally :)

I tried to import data from an excel doc. I read data cell by cell. When i tried to read real value and assign it to my table's field, i had different values.

The code (method) :

-------------------------------------------------------------------------------------------------------------------------------
void importFromExcel()
{

myTable myTable;

#excel

app =
SysExcelApplication::construct();

Workbooks = app.Workbooks();

COMVariant1 = new COMVariant();
COMVariant1.bStr("C:\\myExcel.xls");
Workbook = Workbooks.Add(COMVariant1);

Worksheets = Workbook.worksheets();
Worksheet = Worksheets.itemFromName("myTable");
Cells = Worksheet.Cells();

i = 2;

// Read first cell of the row
RCell = Cells.Item(i, 1);
ttsbegin;
// while first cell of the row is not empty      May I know that a row is empty or not?
while (RCell.Value().bStr() != '')
{
OySysInteg1.GroupId = RCell.value().bStr();
RCell = Cells.Item(i, 2);
OySysInteg1.Description = RCell.value().bStr();
RCell = Cells.Item(i, 3);                                                 // Third column is integer
OySysInteg1.FieldInt = str2int(RCell.value().toString());    // I can't use RCell.value().int()
RCell = Cells.Item(i, 4);                                                    // This column contain reals
OySysInteg1.FieldReal = str2num(RCell.value().toString());  // I cant get the same real
RCell = Cells.Item(i, 5);
OySysInteg1.FieldDate = RCell.value().date();

OySysInteg1.insert();
i++;
RCell = Cells.Item(i, 1);
}

ttscommit;

}
-------------------------------------------------------------------------------------------------------------------------------

I insertd my new problems btwn the lines with diff. colors.
I use the debug option of the Axapta frequently. I created a watch to see the value of  "RCell.value().toString()" but  I cant. Cell of RCell is of the object type "Range". What is the "Range" type?
Why I couldnt get the integer and real values using  "RCell.value().int()" and "RCell.value().float()" functions. Any idea?

Best Regards,

Baran

           
---------------------------------
Do you Yahoo!?
Friends.  Fun. Try the all-new Yahoo! Messenger

[Non-text portions of this message have been removed]



Yahoo! Groups Sponsor
ADVERTISEMENT
click here


Yahoo! Groups Links

Reply via email to