xBrowse and ToExcel()

xBrowse and ToExcel()

Postby Maurizio » Thu Jan 29, 2009 5: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
User avatar
Maurizio
 
Posts: 824
Joined: Mon Oct 10, 2005 1:29 pm

Re: xBrowse and ToExcel()

Postby Silvio » Thu Jan 29, 2009 5:33 pm

here run ok
Best Regards, Saludos

Falconi Silvio
User avatar
Silvio
 
Posts: 3107
Joined: Fri Oct 07, 2005 6:28 pm
Location: Teramo,Italy

Re: xBrowse and ToExcel()

Postby byte-one » Thu Jan 29, 2009 6: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
User avatar
byte-one
 
Posts: 1048
Joined: Mon Oct 24, 2005 9:54 am
Location: Austria

Re: xBrowse and ToExcel()

Postby Maurizio » Tue Feb 03, 2009 4:25 pm

This is a sample that explain the problem

Code: Select all  Expand view
#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][IMG]http://img162.imageshack.us/img162/4546/immagineys6.th.png[/img][/img]
User avatar
Maurizio
 
Posts: 824
Joined: Mon Oct 10, 2005 1:29 pm


Return to FiveWin for Harbour/xHarbour

Who is online

Users browsing this forum: No registered users and 71 guests