TOEXCEL()

Post Reply
User avatar
Otto
Posts: 6404
Joined: Fri Oct 07, 2005 7:07 pm
Has thanked: 24 times
Been thanked: 2 times
Contact:

TOEXCEL()

Post by Otto »

Dear Mr. Rao,

if have 2 questions concerning TOEXCEL()

1. With the German version of EXCEL numeric values need a comma as instead of a dot.
Is there a setup for this?

2. If there are text fields containing a RETURN you get wrong export results.

Thanks in advance
Otto
********************************************************************
mod harbour - Vamos a la conquista de la Web
modharbour.org
https://www.facebook.com/groups/modharbour.club
********************************************************************
User avatar
Otto
Posts: 6404
Joined: Fri Oct 07, 2005 7:07 pm
Has thanked: 24 times
Been thanked: 2 times
Contact:

Re: TOEXCEL()

Post by Otto »

Dear Mr. Rao,
I tested with these changes:

Code: Select all | Expand


METHOD ClpRow( lFullRow, aCols ) CLASS TXBrowse

   local n, RetVal := ""

   DEFAULT lFullRow  := ( ::nMarqueeStyle >= 4 ) .or. aCols != nil
   DEFAULT aCols     := ::GetVisibleCols()

   if lFullRow
 
      for n := 1 to Len( aCols )
   
        if  aCols[ n ]:cDataType  == 'N'
            RetVal += StrTran( StrTran( StrTran( aCols[ n ]:ClpText, ".", "," ), CRLF, " ; " ), Chr(9), ' ' ) + Chr( 9 )
        else
            RetVal += StrTran( StrTran( StrTran( aCols[ n ]:ClpText, CRLF, "" ), Chr(13), " ; " ), Chr(9), ' ' ) + Chr( 9 )
        endif
     
      next
   else
      RetVal := StrTran( StrTran( ::SelectedCol():ClpText, CRLF, " ; " ), Chr(9), ' ' )
   endif

return RetVal

//----------------------------------------------------------------------------//

 


This is working fine for me (German version).
Best regards,
Otto
********************************************************************
mod harbour - Vamos a la conquista de la Web
modharbour.org
https://www.facebook.com/groups/modharbour.club
********************************************************************
User avatar
nageswaragunupudi
Posts: 10721
Joined: Sun Nov 19, 2006 5:22 am
Location: India
Been thanked: 8 times
Contact:

Re: TOEXCEL()

Post by nageswaragunupudi »

About RETURN in text values:

We were substituting SEMICOLON for CRLF. We were not testing for single CHR(13). We can now add that too.
Instead of SEMICOLON is it not okay to substitute CRLF, CR, LF, TAB with SINGLE SPACE?

About Numeric Values:

Before we finalize any modifications, can you please help me with the following simple test?

Please type 23.45 in Notepad. Copy and Paste this text 23.45 into a cell in excel sheet. Does this give an error? I do not think so.
Can you please test and let me know?
Regards

G. N. Rao.
Hyderabad, India
User avatar
Otto
Posts: 6404
Joined: Fri Oct 07, 2005 7:07 pm
Has thanked: 24 times
Been thanked: 2 times
Contact:

Re: TOEXCEL()

Post by Otto »

Dear Mr. Rao,
Sometimes users copy & paste parts of the name, town, street from the internet. This way it is possible that a CR is part of the text inside the dbf-fields.
>Please type 23.45 in Notepad. Copy and Paste this text 23.45 into a cell in excel sheet. Does this give an error? I do not think so.
>Can you please test and let me know?
It does not give an error but inside EXCEL it is a string. As you format the cell first you can’t do anything inside the column.
It is like “editing prohibited” but I controlled and then I changed the code like I posted and all works fine.
Best regards,
Otto


Mag. Otto Atzwanger
********************************************************************
mod harbour - Vamos a la conquista de la Web
modharbour.org
https://www.facebook.com/groups/modharbour.club
********************************************************************
User avatar
nageswaragunupudi
Posts: 10721
Joined: Sun Nov 19, 2006 5:22 am
Location: India
Been thanked: 8 times
Contact:

Re: TOEXCEL()

Post by nageswaragunupudi »

Thanks and appreciate the feedback.

This should be giving problem to all users of European Lang installations. Wondering why till now no user has complained. Before making final modifications in the xbrowse.prg, we like to invite comments from other users too, using Spanish, Italian, etc. installations of Excel.
Regards

G. N. Rao.
Hyderabad, India
Post Reply