Con este codigo genero este browse
- Code: Select all Expand view RUN
local oBrw, oRs
TEXT INTO cSql
SELECT Nivel1, Nivel2,TotMes01,TotMes02, TotMes03, TotMes04, TotMes05 FROM
(
SELECT nivel1, nivel2, SUM( in01 ) AS TotMes01, sum(in02) as TotMes02, sum(in03) as TotMes03, sum(in04) as TotMes04, sum(in05) as TotMes05
FROM #ping
GROUP BY Nivel1, nivel2
WITH ROLLUP
) C
ORDER BY Nivel1, Nivel2
ENDTEXT
TRY
oRs := FW_OpenRecordSet( oConnect, cSql, adLockOptimistic ) // adLockBatchOptimistic
CATCH oError
MsgStop( oError:Description )
END
aSum := { oRs:Fields( "TotMes01" ):Value, oRs:Fields( "TotMes02" ):Value, oRs:Fields( "TotMes03" ):Value, oRs:Fields( "TotMes04" ):Value, oRs:Fields( "TotMes05" ):Value }
DEFINE FONT oFont NAME "TAHOMA" SIZE 0,-13
DEFINE DIALOG oDlg SIZE 700,500 PIXEL TRUEPIXEL FONT oFont
@ 20,20 XBROWSE oBrw SIZE -20,-20 PIXEL OF oDlg ;
DATASOURCE oRs AUTOCOLS ;
CELL LINES NOBORDER FOOTERS
WITH OBJECT oBrw
:TotMes01:cFooter := aSum[ 1 ]
:TotMes02:cFooter := aSum[ 2 ]
:TotMes03:cFooter := aSum[ 3 ]
:TotMes04:cFooter := aSum[ 4 ]
:TotMes05:cFooter := aSum[ 5 ]
:AutoFit()
:CreateFromCode()
END
@ 480,10 BTNBMP PROMPT "Go to Excel " SIZE 80,20 FLAT PIXEL OF oDlg ACTION oBrw:ToExcel()
ACTIVATE DIALOG oDlg CENTERED ;
ON INIT ( ;
oBrw:SetTree( 2, { FWDArrow(), FWRArrow() } ), ;
oBrw:bClrStds := { || { CLR_BLACK, If( oBrw:oTreeItem:nLevel == 1, 0x68DDFB, CLR_WHITE ) } } ;
)
RELEASE FONT oFont
return nil
Pero quisiera llevarlo a excel y se vea subtotalizado, asi:
No logro hacerlo, existe el parametro nGroupby del metodo toExcel pero no se como usarlo, uso fwh 17.12
Otra opcion seria usar el metodo subtotal de la clase TexcelScript, alguien tiene algun ejemplo?
Gracias