problem with report to excel

Re: problem with report to excel

Postby nageswaragunupudi » Mon Sep 04, 2023 2:03 pm

As of now we are supporting Excel language translations for only
1 English, 2 Spanish, 3 French, 4 Portuguese, 5 German, 6 Italian
'en', 'es', 'fr', 'pt', 'de', 'it'

With your help and support, we will try to provide support for Dutch also.

Please help me with this information:
1) Like 'de' for German, 'es' for Spanish, what is it for Dutch?
2) Please provide translations for:
SUBTOTAL( -> SUBTOTAAL(
SUM( --> ???
TRUE --> ???
FALSE --> ???

Please run the small test and let us know the results:
Code: Select all  Expand view

oExcel         := ExcelObj()
? nExcelLangID   := oExcel:LanguageSettings:LanguageID( 2 )
? cDecimalSeparator    := oExcel:International[ 3 ]
? cThousandsSeparator  := oExcel:International[ 4 ]
? cListSeparator       := oExcel:International[ 5 ]
 


If you don't mind me asking, are you from Netherlands?
Regards

G. N. Rao.
Hyderabad, India
User avatar
nageswaragunupudi
 
Posts: 10624
Joined: Sun Nov 19, 2006 5:22 am
Location: India

Re: problem with report to excel

Postby nageswaragunupudi » Mon Sep 04, 2023 2:20 pm

Please try if this change is working for you
Code: Select all  Expand view
           cFormula:= "SUBTOTAAL(" + ;
                        LTrim( Str( FW_DeCode( IfNil( oCol:nFooterType, 0 ), AGGR_SUM, 9, AGGR_MAX, 4, AGGR_MIN, 5, ;
                        AGGR_COUNT, 3, AGGR_AVG, 1, AGGR_STDEV, 7, AGGR_STDEVP, 8, 9 ) ) ) + ;
                        ";" + ;
                        oSheet:Range( oSheet:Cells( 2, nCol ), ;
                                      oSheet:Cells( nRow - 1, nCol ) ):Address( .f., .f. ) + ;
                        ")"
            oSheet:Cells( nRow, nCol ):Formula := '=' + cFormula
 
Regards

G. N. Rao.
Hyderabad, India
User avatar
nageswaragunupudi
 
Posts: 10624
Joined: Sun Nov 19, 2006 5:22 am
Location: India

Re: problem with report to excel

Postby bart » Mon Sep 04, 2023 5:13 pm

Hello Mr. Rao,

1) Like 'de' for German, 'es' for Spanish, what is it for Dutch? -> 'nl' is the iso code for Dutch and Flemish.
2) Please provide translations for:
SUBTOTAL( -> SUBTOTAAL(
SUM( --> ??? - > SOM(
TRUE --> ??? -> WAAR
FALSE --> ??? -> ONWAAR

Language ID = 1043
Decimal separator = ,
Thousands separator = .
List separator = ;

I live in Belgium.

Best regards
Bart
bart
 
Posts: 10
Joined: Tue Feb 10, 2015 9:11 pm

Re: problem with report to excel

Postby nageswaragunupudi » Mon Sep 04, 2023 8:00 pm

Can you please make these changes in
fwh\source\function\olefuncs.prg
and test with toexcel() methods of Report and XBrowse please?

Please replace these three functions
Code: Select all  Expand view

function ExcelLangID()
function ExcelLang()
function ExcelTranslate( cFunc )
 


with these modified functions:
Code: Select all  Expand view

function ExcelLangID()

   local oExcel
   local aID   := { ;
   { 1033, 2057, 10249, 4105, 9225, 14345, 6153, 8201, 5129, 13321, 7177, 11273, 12297 }, ;
   { 3082,1034,11274,16394,13322,9226,5130,7178,12298,17418,4106,18442,;
                     58378,2058,19466,6154,15370,10250,20490,21514,14346,8202 }, ;
   { 1036,2060,11276,3084,9228,12300,15372,5132,13324,6156,14348,58380,8204,10252,4108,7180 }, ;
   { 1046, 2070 }, ;
   { 1031,3079,5127,4103,2055 }, ;
   { 1040, 2064 }, ;
   { 1043 } }

   // 1 English, 2 Spanish, 3 French, 4 Portuguese, 5 German, 6 Italian, 7 Dutch

   if nExcelLangID == nil
      oExcel         := ExcelObj()
      nExcelLangID   := If( oExcel == nil, 0, oExcel:LanguageSettings:LanguageID( 2 ) )
      nExcelLangNo   := AScan( aID, { |a| AScan( a, nExcelLangID ) > 0 } )
      TRY
         cDecimalSeparator    := oExcel:International[ 3 ]
         cThousandsSeparator  := oExcel:International[ 4 ]
         cListSeparator       := oExcel:International[ 5 ]
      CATCH
      END
   endif

return nExcelLangID

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

function ExcelLang()

   if nExcelLangNo == nil
      ExcelLangID()
   endif

return { 'en', 'es', 'fr', 'pt', 'de', 'it', 'nl' }[ Max( 1, nExcelLangNo ) ]

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

function ExcelTranslate( cFunc )

   local cRet, nAt, cName

   // 1 English, 2 Spanish, 3 French, 4 Portuguese, 5 German, 6 Italian, 7 Dutch
   local aTranslates := { ;
   { "TRUE",      "VERDADERO",   "VRAI",        "VERDADEIRO", "WAHR",          "VERO",       "WAAR"   }, ;
   { "FALSE",     "FALSO",       "FAUX",        "FALSO",      "FALSCH",        "FALSO",      "ONWAAR" }, ;
   { "SUM(",      "SUMA(",       "SOMME(",      "SOMA(",      "SUMME(",        "SOMMA(",     "SOM("   }, ;
   { "SUBTOTAL(", "SUBTOTALES(", "SOUS.TOTAL(", "SUBTOTAL(",  "TEILERGEBNIS(", "SUBTOTALE(", "SUBTOTAAL(" }, ;
   { ',',         ';',           ';',           ';',          ';',              ';',         ';' } ;
   }

   if nExcelLangNo == nil
      ExcelLangID()
   endif
   cFunc       := Upper( cFunc )
   cRet        := cFunc
   if nExcelLangNo > 1 .and. nExcelLangNo <= 7
      // Translation required
      cName    := cFunc
      if ( nAt := At( '(', cFunc ) ) > 0
         cName    := Left( cFunc, nAt )
      endif
      if ( nAt := AScan( aTranslates, { |a| a[ 1 ] == cName } ) ) > 0
         cRet     := StrTran( cFunc, cName, aTranslates[ nAt, nExcelLangNo ] )
      endif
   elseif nExcelLangNo != 1
      if cRet == "TRUE";  cRet := "1=1"; endif
      if cRet == "FALSE"; cRet := "1=0"; endif
   endif

   if cListSeparator != ','
      cRet     := StrTran( cRet, ',', cListSeparator )
   endif

return cRet
 


Please provide your feedback.
Please use the original xbrowse and report programs of FWH without modifications.
Regards

G. N. Rao.
Hyderabad, India
User avatar
nageswaragunupudi
 
Posts: 10624
Joined: Sun Nov 19, 2006 5:22 am
Location: India

Previous

Return to FiveWin for Harbour/xHarbour

Who is online

Users browsing this forum: No registered users and 93 guests