FiveTech Support Forums

FiveWin / Harbour / xBase community
Board index FiveWin for Harbour/xHarbour TOEXCEL()
Posts: 6983
Joined: Fri Oct 07, 2005 07:07 PM
TOEXCEL()
Posted: Fri Apr 05, 2013 09:40 AM

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

Posts: 6983
Joined: Fri Oct 07, 2005 07:07 PM
Re: TOEXCEL()
Posted: Fri Apr 05, 2013 01:40 PM
Dear Mr. Rao,
I tested with these changes:
Code (fw): Select all Collapse
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
Posts: 10733
Joined: Sun Nov 19, 2006 05:22 AM
Re: TOEXCEL()
Posted: Fri Apr 05, 2013 06:10 PM

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
Posts: 6983
Joined: Fri Oct 07, 2005 07:07 PM
Re: TOEXCEL()
Posted: Fri Apr 05, 2013 07:19 PM

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

Posts: 10733
Joined: Sun Nov 19, 2006 05:22 AM
Re: TOEXCEL()
Posted: Fri Apr 05, 2013 10:49 PM

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

Continue the discussion