Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Using Greg Green XLSXWorkBookVFPX for extracting from Ex
Message
From
30/11/2018 14:09:55
 
General information
Forum:
Visual FoxPro
Category:
Third party products
Miscellaneous
Thread ID:
01663900
Message ID:
01663944
Views:
39
>Then I call GetSheetRowValues() to get the row values.
>Question: do these values go into a cursor that I can read/browse? I tried the cursor named "xl_cells" (that you suggested) but it does not exist.
>And even after the code gets a row value, do you have to manually populate it? Or is there a cursor that get filled?

One point - the cursors are destroyed when the instance of the workbook class is closed. The method GetSheetRowValues() just returns a row object (from docs):

Return object:
loRow.Count Number of columns returned in row
loRow.Values[nCol, 1] Cell value set to data type of the cell
loRow.Values[nCol, 2] Cell data type
A NULL value for a column indicates a value is not set. If a failure occurs (sheet or column does not exist, then a NULL is returned).

Since it is not known what the columns are in terms of a field for a table, I did not try to code that method into the class. You as the developer would have to decide what the table fields are and the data types for your table. XLSX actually has a limited support of data types - date, datetime, string, and numeric (it really does not distinguish between numeric types) and most of this is based on the format assignment to the cell. So you have to decide what to do with the cell values and how to store into your table. The class determines the cell data type and returns that info to you in addition to the value.

You can loop through the xl_cells cursor -- the keys are workbook, sheet, col, row. The cell value is contained in the field cellvalue as a string; however, if it is a string in the cell, it is stored into the xl_strings cursor and the cellvalue field contains the key value for the xl_string row. The data type of the cell value is stored in the field datatype (standard return values for VARTYPE() function). I have an include file that has the DEFINES.
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform