Welcome To The Home Of The Visual FoxPro Experts  
home. signup. forum. archives. search. google. articles. downloads. faq. members. weblogs. file info. rss.
 From: Tai Nguyen
  Where is Tai Nguyen?
 
 United States
 Tai Nguyen
 To: Yousfi Benameur
  Where is Yousfi Benameur?
 El Bayadh
 Algeria
 Yousfi Benameur
 Tags
Subject: RE: Memo field
Thread ID: 310600 Message ID: 310719 # Views: 33 # Ratings: 1
Version: Visual FoxPro 9 Category: General VFP Topics
Date: Thursday, June 23, 2011 7:59:38 PM         
   


> > Hi,
> >
> > I run this "select" statement to export the data onto the excel format.
> >
> > select field1, field2, left(memofield,254), field4, field5 from table into cursor tempCur
> > copy to "C:\report.xls" type xl5
> >
> > The problem is, I can't export more than 254 characters and so what are the techniques that you are using to do this same job? Thanks.
> >
> > Tai Nguyen.
>
> I have an old code exporting a table having even memo fields to excel.try it
> it begins with cerating a cursor with memos,creating a csv file and saving into excel file...maybe helps you.
>
> *export a dbf file with memo to excel file
> 
> *built a cursor for working
> local aa,afile
> aa=""
> for i=1 to 50
> aa=aa+repli(chr(i+64) ,80)+chr(13)
> endfor
> set memowidth to 80     &&adjustable
> 
> create cursor ycurs (champ1 c(30),champ2 c(30), ymemo M)
> for i=1 to 10
> appe blan
> repl champ1 with "Enregistrement Number "+trans(i)
> REPLACE champ2 WITH "Test dbf memo to excel"+TRANSFORM(i)
> repl ymemo with "Record #"+trans(recno())+"//////"+aa+chr(10)
> endfor
> brow
> go top
> ******************************************
> afile="c:\asup.csv"
> set safe off
> set textmerge on to (afile) noshow
> \Champ1,Champ2,Ymemo
> scan
> \ "<< trim(champ1) >>","<<TRIM(champ2)>>","<< trim(chrtran(ymemo,chr(13)+chr(10),'  ')) >>"
> endscan
> set textmerge to
> USE in ycurs
> 
> 
> local bfile
> oExcel = CREATEOBJECT('Excel.Application')
> bfile=oExcel.WorkBooks.open("c:\asup.csv")
> # define xlNormal = -4143     
> bfile.SaveAs(addbs(justpath(afile))+juststem(afile)+".xls",-4143)
> oexcel.quit
> set safe on
> 
> RUN start c:\asup.xls
> 

>
> Regards
> Yousfi Benameur

--------------------------------------------------------------------------
--------------------------------------------------------------------------

Yes, that helps me. Thank you.

Ps: One of the things, I found when I tried (should not affect in my case because users enter text from the GUI instead) was that copying and pasting the whole word document into this memo field would cause an issue like when it exported to Excel, it dumped the whole memo onto Excel cells (instead of just 1 cell) because of the commas in the sentences or paragraphs. Correct me if I were wrong, you didn't want the rating right (as far as I could remember).

Tai Nguyen.

ENTIRE THREAD

Memo field Posted by Tai Nguyen @ 6/22/2011 9:27:49 PM
RE: Memo field Posted by Cetin Basoz @ 6/22/2011 11:03:23 PM
RE: Memo field Posted by Tai Nguyen @ 6/23/2011 3:37:32 AM
RE: Memo field Posted by Cetin Basoz @ 6/24/2011 1:45:32 PM
RE: Memo field Posted by Yousfi Benameur @ 6/23/2011 5:52:43 PM
RE: Memo field Posted by Tai Nguyen @ 6/23/2011 7:59:38 PM
RE: Memo field Posted by Yousfi Benameur @ 6/23/2011 8:08:20 PM
RE: Memo field Posted by Tai Nguyen @ 6/23/2011 8:16:08 PM
RE: Memo field Posted by Anders Altberg @ 6/25/2011 7:16:02 PM