Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Fill Excel range with XML?
Message
De
19/11/2003 10:26:22
Cetin Basoz
Engineerica Inc.
Izmir, Turquie
 
 
À
19/11/2003 10:19:41
Mike Yearwood
Toronto, Ontario, Canada
Information générale
Forum:
Visual FoxPro
Catégorie:
XML, XSD
Divers
Thread ID:
00849641
Message ID:
00851425
Vues:
24
Primitive :) Maybe but easy and fast. You might try QueryTables.Add as an alternative.
Cetin

>Hi Cetin
>
>Using Copy/Paste seems a little primative, but I'll try it.
>
>Thanks!
>>>Hi all
>>>
>>>I've got about 10,000 records to dump into Excel. There are about 10 client with that many records each. As Tamar Granor puts it in her (and Della Martin's) book, "This method of populating the data ... performs well on small data sets".
>>>
>>>I'm wondering if there is a way to get Excel to fill a range with a chunk of XML. If so, please share some example code.
>>>
>>>Thanks!
>>
>>Mike,
>>Directly using XML should be version dependant (at least the version I'm using - XL2000 - doesn't have a direct support). Indirectly it could use OLEDB with MSDAOSP provider but really sucks IMHO.
>>
>>OTOH you could easily use XMLToCursor() and manipulate data for excel. Passing this data to excel has a zillions way of doing it and each approach have some pros/cons. One of the simpliest ways is to copy the data to a tab delimited format and paste to a range in excel. ie:
>>
>>
>>use (_samples+'data\orditems')
>>
>>lcTemp = Sys(2015)+'.tmp'
>>Copy To (lcTemp) Type csv for .f.
>>_Cliptext = Chrtran(Filetostr(lcTemp),',',Chr(9))
>>Copy To (lcTemp) Type Delimited With "" With Tab
>>_Cliptext = _Cliptext + Filetostr(lcTemp)
>>Erase (lcTemp)
>>
>>USE in 'orditems'
>>
>>oExcel = Createobject('Excel.Application')
>>With oExcel
>>  .Workbooks.Add
>>  .Activeworkbook.Activesheet.Range('B5').PasteSpecial()
>>  .Selection.Name = 'myData' && Name the part we pasted
>>  .Range('A1').Activate      && Just to release current selection
>>  .Range('myData').Columns.Autofit && Use named range
>>  .Visible = .T.
>>Endwith
>>
Cetin
Çetin Basöz

The way to Go
Flutter - For mobile, web and desktop.
World's most advanced open source relational database.
.Net for foxheads - Blog (main)
FoxSharp - Blog (mirror)
Welcome to FoxyClasses

LinqPad - C#,VB,F#,SQL,eSQL ... scratchpad
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform