TOEXCEL()

TOEXCEL()

Postby Otto » Fri Apr 05, 2013 9: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
********************************************************************
mod harbour - Vamos a la conquista de la Web
modharbour.org
https://www.facebook.com/groups/modharbour.club
********************************************************************
User avatar
Otto
 
Posts: 6332
Joined: Fri Oct 07, 2005 7:07 pm

Re: TOEXCEL()

Postby Otto » Fri Apr 05, 2013 1:40 pm

Dear Mr. Rao,
I tested with these changes:
Code: Select all  Expand view

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
Otto
 
Posts: 6332
Joined: Fri Oct 07, 2005 7:07 pm

Re: TOEXCEL()

Postby nageswaragunupudi » Fri Apr 05, 2013 6: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
User avatar
nageswaragunupudi
 
Posts: 10632
Joined: Sun Nov 19, 2006 5:22 am
Location: India

Re: TOEXCEL()

Postby Otto » Fri Apr 05, 2013 7: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
********************************************************************
mod harbour - Vamos a la conquista de la Web
modharbour.org
https://www.facebook.com/groups/modharbour.club
********************************************************************
User avatar
Otto
 
Posts: 6332
Joined: Fri Oct 07, 2005 7:07 pm

Re: TOEXCEL()

Postby nageswaragunupudi » 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
User avatar
nageswaragunupudi
 
Posts: 10632
Joined: Sun Nov 19, 2006 5:22 am
Location: India


Return to FiveWin for Harbour/xHarbour

Who is online

Users browsing this forum: No registered users and 106 guests