FiveTech Support Forums

FiveWin / Harbour / xBase community
Board index FiveWin para Harbour/xHarbour xBrowse ToExcel formulado con FormulaR1C1
Posts: 694
Joined: Fri Oct 07, 2005 06:58 AM
xBrowse ToExcel formulado con FormulaR1C1
Posted: Fri May 07, 2010 11:34 AM
Tengo problemas con el método FormulaR1C1

No calcula la formula. En la celda de excel aparace #¿NOMBRE? teniendo la celda la formula =SUBTOTALES(9;R2C11:R3C11)

Lo que tendría que hacer es sumar de la columna k fila 2 a la columna k fila 3
La columna k es la 11 por lo que la formulación es correcta pero excel no lo interpreta.

Uso Excel 2003

He probando cambiando en el método ToExcel

Code (fw): Select all Collapse
oSheet:Cells( nRow, nCol ):Formula := "=" + cxlAggr + excelRange2( 2, nCol, nRow - 1 ) + ')' // FWH 9.11 + ')' added  //...fgondi
//oSheet:Cells( nRow, nCol ):FormulaR1C1 := "=" + cxlAggr + excelRange( 2, nCol, nRow - 1 ) + ')' // FWH 9.11 + ')' added


Siendo la función ExcelRange2

Code (fw): Select all Collapse
static function excelCell2( r, c )
return Chr( 65+c-1 ) + LTrim( Str( r ) )


Y funciona correctamente.

¿Tengo que cambiar algo en excel para que funciones?, si es así, sería un problema gordo, porque no puedo ir verificando equipo por equipo de los clientes.
Un saludo

Fernando González Diez

ALSIS Sistemas Informáticos
Posts: 10733
Joined: Sun Nov 19, 2006 05:22 AM
Re: xBrowse ToExcel formulado con FormulaR1C1
Posted: Sat May 08, 2010 03:31 AM
ToExcel() method is fully tested and working well in English installations, but not well tested on other language installations. From your posting it appears R1C1 style is not working well in some installations.

With the corrections you made already, ToExcel() should work correctly if the total columns are not more than 26. No other corrections are necessary.

This is a better replacement for the code. This new code is language indepedant and should work correctly in all installations.
Code (fw): Select all Collapse
               oSheet:Cells( nRow, nCol ):Formula := "=" + cxlAggr + ;
                  oSheet:Range( oSheet:Cells( 2, nCol ), oSheet:Cells( nRow - 1, nCol ) ):Address + ")"

Can you please try and inform if this change is working correctly?
Regards



G. N. Rao.

Hyderabad, India
Posts: 694
Joined: Fri Oct 07, 2005 06:58 AM
Re: xBrowse ToExcel formulado con FormulaR1C1
Posted: Mon May 10, 2010 10:11 AM

nageswaragunupudi,

Con ese cambio, funciona correctamente.

Un saludo

Fernando González Diez

ALSIS Sistemas Informáticos

Continue the discussion