Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Memo fld.
Message
De
18/04/2000 20:08:39
 
Information générale
Forum:
Visual FoxPro
Catégorie:
Base de données, Tables, Vues, Index et syntaxe SQL
Titre:
Divers
Thread ID:
00361103
Message ID:
00361108
Vues:
21
>Hi, sorry to disturb. But saw you online and thought i would ask you a question. I need to export the data from a table to an excel sheet. But i find that I am not able to display the contents of the memo field in the excel sheet. I am getting a blank when i issue the command "Export to filename Type XL5". Can anyone help me overcome this ?? Please contact me at dinkhanna@hotmail.com or dinkhy@yahoo.com.

The copy to command does not export memo files. There are a number of workarounds for this.

1) if you can count on your memo fields being 254 characters or fewer, create a cursor from the table you are exporting -- with the memo fields converted to character strings. Then export those to Excel.

example:
Select fld1, LEFT(memofld+space(254),254) as fld2 FROM table into cursor forexcelcopy

Select forexcelcopy

COPY TO excelfilename tyep XL5.
2) If that is not possible, create an active x excel object. Write to the sheet thus created one cell at time. The following is example of code that simply creates an instance of excel, writes to one cell, saves the sheet and closes the instance. Given this, you ought to be able to figure out how to get any data you want into any place in Excel you want. This the ultra-minimal command set; this does not even scratch the surface of what you can do with an Excel instance in any program that can access active-x servers...
public go_excel
go_excel=CreateObject("excel.application")
y=go_excel.workbooks.add
y.sheets(1).name="gar5"
go_excel.sheets(1).name="gar5"
go_excel.sheets(1).cells(3,4)="gar"
go_excel.sheets(1).saveas("gar5")
go_excel.quit()
go_excel.visible=.t.
RELEASE go_excel
I
Thanks

Gar W. Lipow
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform