FiveTech Support Forums

FiveWin / Harbour / xBase community
Board index FiveWin para Harbour/xHarbour Planilla Excel generada desde el Preview tiene errores
Posts: 117
Joined: Sun Oct 08, 2017 12:51 PM
Planilla Excel generada desde el Preview tiene errores
Posted: Thu Jul 05, 2018 04:48 PM
Hola gente !
A partir del ejemplo FWH\samples\report\rep10.prg, el cual tiene subtotales, lo tomé como base para realizar uno mio.
Resulta que el Preview se genera correctamente, pero cuando pulso el ícono para generar la planilla Excel sale con errores
en los totales.
Les adjunto el código, una imágen del Preview y otra de la planilla excel.
en el Preview me muestra correctamente los cortes por los 5 vendedores que tengo, mientras que en Excel me muestra
los cortes, pero me muestra solamente 1 vendedor.

Code (fw): Select all Collapse
*--------------------------------------
FUNCTION VTA1325L1()
*--------------------------------------
local oReport
local oFont1
local oFont2

sele 99
set order to 5  // ordenado por nom_ven (nombre vendedor)
go top
PRINTER oReport NAME "Comisiones Vendedores"
DEFINE FONT oFont1 NAME "Arial" SIZE 0,-9 BOLD
DEFINE FONT oFont2 NAME "Arial" SIZE 0,-8
REPORT oReport;
   TITLE "COMISIONES DE VENDEDORES. PERIODO: "+dtoc(xfde)+" AL "+dtoc(xfha) ;
   FONT oFont1, oFont2 ;
   HEADER m->empresa+"   -   Fecha: " + DToC( Date() ) ;
   FOOTER "Página: " + Str( oReport:nPage, 3 ) ;
   PREVIEW NAME "Comisiones Vendedores" ;
   CAPTION "Comisiones Vendedores"
    
GROUP ON 99->nom_ven+" "+str(99->vendedor,2) ;
   HEADER "Vendedor "+oReport:aGroups[1]:cValue ;
   FOOTER "Total Vendedor " +oReport:aGroups[1]:cValue 
    
COLUMN TITLE "Cli."       DATA 99->cliente     FONT 2
COLUMN TITLE "Nombre"     DATA 99->nom_cli     FONT 2
COLUMN TITLE "Fecha"      DATA dtoc(99->fecha) FONT 2
COLUMN TITLE "Detalle"    DATA 99->detalle     FONT 2                                    
COLUMN TITLE "Costo"      DATA 99->costo       FONT 2 picture "@E 9,999,999.99" TOTAL                                   
COLUMN TITLE "Fact.S/IVA" DATA 99->facturado   FONT 2 picture "@E 9,999,999.99" TOTAL                                   
COLUMN TITLE "Comisión"   DATA 99->com_fac     FONT 2 picture "@E 9,999,999.99" TOTAL                                   
COLUMN TITLE "% Rentab"   DATA 99->por_ren     FONT 2 
COLUMN TITLE "Ganancia"   DATA 99->ganancia    FONT 2 picture "@E 9,999,999.99" TOTAL   
END REPORT
oReport:bInit:={||.t.}        
oReport:bInit := { || dbGoTop()  }
oReport:lPageTotal:=.f. 
ACTIVATE REPORT oReport
oFont1:End()
oFont2:End()
return nil


http://www.lav-sis.com.ar/previo.jpg

http://www.lav-sis.com.ar/excel.jpg
Pedro L. Lavallen

San Luis (Capital), Argentina
Posts: 1344
Joined: Wed Nov 16, 2005 09:14 PM
Re: Planilla Excel generada desde el Preview tiene errores
Posted: Thu Jul 05, 2018 10:57 PM
Reemplaza esto y dime como te muestra
Code (fw): Select all Collapse
GROUP ON 99->nom_ven;
   HEADER "Vendedor " 99->nom_ven+" "+str(99->vendedor,2) ;
   FOOTER "Total Vendedor "
Posts: 117
Joined: Sun Oct 08, 2017 12:51 PM
Re: Planilla Excel generada desde el Preview tiene errores
Posted: Tue Jul 10, 2018 10:04 PM

Muchas gracias !
Funcionó perfecto !

Pedro L. Lavallen

San Luis (Capital), Argentina

Continue the discussion