FiveTech Support Forums

FiveWin / Harbour / xBase community
Board index FiveWin for Harbour/xHarbour xBrowse and ToExcel()
Posts: 842
Joined: Mon Oct 10, 2005 01:29 PM
xBrowse and ToExcel()
Posted: Thu Jan 29, 2009 05:29 PM

Hello

I remarked that when I use xbrowse Toexcel() in excel the numer are always wrong .
I try to use xbrNumFormat() but the number but without success .

It's a xbrowse bug ?

Regards Maurizio

Posts: 3107
Joined: Fri Oct 07, 2005 06:28 PM
Re: xBrowse and ToExcel()
Posted: Thu Jan 29, 2009 05:33 PM

here run ok

Best Regards, Saludos



Falconi Silvio
Posts: 1048
Joined: Mon Oct 24, 2005 09:54 AM
Re: xBrowse and ToExcel()
Posted: Thu Jan 29, 2009 06:19 PM

I found, that if numbers as characterfield defined, then Excel marked it as "error". If it real numbers with decimals, then it is ok.

Regards,
Günther
---------------------------------
office@byte-one.com
Posts: 842
Joined: Mon Oct 10, 2005 01:29 PM
Re: xBrowse and ToExcel()
Posted: Tue Feb 03, 2009 04:25 PM
This is a sample that explain the problem

#include 'fivewin.ch'
#include 'xbrowse.ch'

static oFont, ovFont,oWnd,oBrw

function main()

   Local aDbf := {}
   Local nX := 1 
   Local cPic := "@ZE 999999.9999"

   ferase("NUMBER.DBF")
   
   AADD (aDbf, {"NUM_1"   ,"N", 12, 3 })
   AADD (aDbf, {"NUM_2"   ,"N", 12, 3 })
   AADD (aDbf, {"NUM_3"   ,"N", 12, 3 })
   dbcreate("NUMBER", aDbf)
  
   xbrNumFormat( "E", .t. )  // "E" for European, "A" for American and others
                             // .t. for showing thousand separators

   use number 
   
   FOR nX := 1 to 10 
       dbappend()
       field->NUM_1 := nX * 0.1
       field->NUM_2 := nX * 10
       field->NUM_3 := nX * 100
   NEXT 
   dbgotop()
   DEFINE FONT oFont NAME 'TAHOMA' SIZE 0,-12
   DEFINE FONT oVfont NAME 'TAHOMA' SIZE 0,-12 NESCAPEMENT 900

   DEFINE WINDOW oWnd  MENU MainMenu()
   oWnd:SetFont( oFont )

   @ 0,0 XBROWSE oBrw ;
      COLUMNS 'NUM_1', 'NUM_2', 'NUM_3' ;
      PICTURE cPic,cPic,cPic ;
      OF oWnd ;
      ALIAS 'NUMBER' ;
      LINES CELL
   
   
   oBrw:CreateFromCode()
   oWnd:oClient := oBrw

   SET MESSAGE OF oWnd TO "XBrowse " 2007

   ACTIVATE WINDOW oWnd 
      

return nil
//===========================
Static Function MAinMenu()
Local oPop 
   MENU oPop 2007
      MENUITEM "Excel" ACTION oBrw:ToExcel()
      MENUITEM "Exit" ACTION oWnd:end()
   ENDMENU
Return oPop


And this is the images
[IMG]http://img162.imageshack.us/img162/4546/immagineys6.th.png" alt="" loading="lazy">[/img]

Continue the discussion