Limited output Xbrowse to exel or csv (SOLVED)

Limited output Xbrowse to exel or csv (SOLVED)

Postby Marc Venken » Sun Feb 26, 2017 11:25 pm

Hello,

I need to export data into a exel or csv file. (for later import into Prestashop shopsystem)

One field is a memo field (dbt or fpt), that can be large (200-600 chars)

I have a point that I can export to exel from Xbrowse, but I see that exel is limited to 255 char in a colom !
I can us COPY TO update.csv DELIMITED, but also this will only give approx 255 char ?

How can I overcome this limit ?

I need to have 1 large field, since the import module from Presta alows 1 field for each imported field.

Marc
Last edited by Marc Venken on Tue Feb 28, 2017 9:48 pm, edited 1 time in total.
Marc Venken
Using: FWH 23.04 with Harbour
User avatar
Marc Venken
 
Posts: 1343
Joined: Tue Jun 14, 2016 7:51 am
Location: Belgium

Re: Limited output Xbrowse to exel or csv

Postby nageswaragunupudi » Mon Feb 27, 2017 11:38 pm

It is possible to export text larger than 255 bytes to Excel.
Code: Select all  Expand view
  local aData := { { 1, memoread( "\fwh\samples\testrad3.prg" ) } }

   xbrowser aData
 

and try exporting from xbrowser. This is working.

But the issue is it is not convenient to view large texts of data in Excel.

Exporting to CSV:

If the source is DBF we can use
COPY TO file.csv DELIMITED
Regards

G. N. Rao.
Hyderabad, India
User avatar
nageswaragunupudi
 
Posts: 10248
Joined: Sun Nov 19, 2006 5:22 am
Location: India

Re: Limited output Xbrowse to exel or csv

Postby Marc Venken » Tue Feb 28, 2017 12:19 am

I tried the sample, and I see that exel will put it on multiple lines. (this could work)

I have to look into it if the import module (php) will correctly use this kind of lines, because I think there will be CTRL into it.
In my program I convert all CTRL into <br> html code for a new line and put all into the memo field.

If the source is DBF we can use
COPY TO file.csv DELIMITED


Partly Sample


Testing software dbftocsv (3th Party)

"14001800";"1";"Werkbroek : 1400";"Algemeen";"1. Broeken";" 33.00";"";"";"";"";"";"";"";"14001800";"";"";"Blaklader";"";"";"";"";"100";"Werkbroek : 1400";"<p><strong>Samenstelling :</strong></p><br>65% polyester, 35% katoen, twill, 240 g/m?<br><p><strong>Gewicht :</strong></p><br>240 g/m?<br><p><strong>Eigenschappen :</strong></p><br>· Twee insteekzakken. <br>· Achterzak met knoopsluiting. <br>· Twee broeks";"";"";"";"";"";"";"";"";"0";"";"Korenblauw";"C148";"";"";"";"";"False";"";"";"";"0";"0";"";"";"<p><strong>Samenstelling :</strong></p><br>65% polyester, 35% katoen, twill, 240 g/m?<br><p><strong>Gewicht :</strong></p><br>240 g/m?<br><p><strong>Eigenschappen :</strong></p><br>· Twee insteekzakken. <br>· Achterzak met knoopsluiting. <br>· Twee broekspijpzakken waarvan een met klep en een met driedelig potloodzakje. <br>· D-ring. <br>· Telefoonzakje<br>"

with COPY TO file.csv DELIMITED

"14001800",1,"Werkbroek : 1400","Algemeen","1. Broeken",33.00,"","","","","","","","14001800","","","Blaklader","","","","",100,"Werkbroek : 1400","<p><strong>Samenstelling :</strong></p><br>65% polyester, 35% katoen, twill, 240 g/m?<br><p><strong>Gewicht :</strong></p><br>240 g/m?<br><p><strong>Eigenschappen :</strong></p><br>· Twee insteekzakken. <br>· Achterzak met knoopsluiting. <br>· Twee broeks","","","","","","","","","0","","Korenblauw","C148","","","","",F,"","","",0,0,"","""



Also tried, but the field is also no longer then 255 chars ?

Maybe I have someware limit in files or config files ??

I see that it must be possible, since Uwe has a dbftocsv utility, but there is a lot more of coding done, and he is writing to a file.csv directly.

He shared the function with me, but not possible to get it working for now. (just received)

Thanks already.
Marc Venken
Using: FWH 23.04 with Harbour
User avatar
Marc Venken
 
Posts: 1343
Joined: Tue Jun 14, 2016 7:51 am
Location: Belgium

Re: Limited output Xbrowse to exel or csv

Postby stefano » Tue Feb 28, 2017 5:26 pm

Ciao

another method
Code: Select all  Expand view
oExcel := CreateObject( "Excel.Application" )
oExcel:WorkBooks:Add()

oAs := oExcel:Activesheet()

oAs:Cells:Font:Name := "Calibri"
oAs:Cells:Font:Size := 11

oAs:Columns( 1 ):ColumnWidth := 17
oAs:Columns( 2 ):ColumnWidth := 150

oAs:Cells( 3, 1 ):Value := "Prog"
oAs:Cells( 3, 2 ):Value := "Note"

n = 1
for n = 1 to 2
 oAs:Cells(3,n):Borders(7):LineStyle := 1
 oAs:Cells(3,n):Borders(8):LineStyle := 1
next

Use archivio
go top
n = 4
do while !eof()
sysrefresh()
    oAs:Cells( n, 1 ):Value := archivio->c1)   // prog
    oAs:Cells( n, 2 ):Value := archivio->c2)   // campo note
    n = n+1
    skip
enddo

n1 = 1
for n1 = 1 to 2
 oAs:Cells(n-1,n1):Borders(9):LineStyle := 1  
next

oAs:Columns( "A:B" ):WrapText = .T.

/*
oAs:Name := "NC"
* oAs:Columns( "A:T" ):AutoFit()
oAs:Columns( "A:Z" ):VerticalAlignment := -4108
oAs:Columns( "A:Z" ):HorizontalAlignment := -4108
oAs:Columns( "C:C" ):HorizontalAlignment := -4131
oAs:Columns( "Q:Q" ):HorizontalAlignment := -4131
 
oAs:Columns( "W:W" ):WrapText = .F.

oAs:Range("I2:Q2"):interior:color := rgb(184,204,228)
oAs:Range("I3:Q3"):interior:color := rgb(217,217,217)
oAs:Range("A3:H3"):interior:color := rgb(54,96,146)
oAs:Range("A3:H3"):font:color := rgb(255,255,255)
*/


 oExcel:visible := .T


Saluti
Stefano
FWH 14.11 + xHarbour + bcc582
stefano
 
Posts: 80
Joined: Tue Mar 25, 2008 9:03 pm
Location: ITALIA

Re: Limited output Xbrowse to exel or csv

Postby Marc Venken » Tue Feb 28, 2017 7:25 pm

Thanks.

Looking into these replys, i noticed that the export from Xbrowse is ok.

Also Exel will except more than 255 char, BUT THE COLOMN IS MAX. 255 LONG. The rest of the data is on the next line, but INSIDE the same row.
I didn't see the data, but the samples above showed a prg in a long row.

Learned samething more about exel !

Sorry for the wrong interpretation of my data :oops:
Thanks for the Effort.
Marc Venken
Using: FWH 23.04 with Harbour
User avatar
Marc Venken
 
Posts: 1343
Joined: Tue Jun 14, 2016 7:51 am
Location: Belgium


Return to FiveWin for Harbour/xHarbour

Who is online

Users browsing this forum: No registered users and 71 guests