STATIC FUNCTION InformCierre( oBrw, oGraph )
LOCAL oRpt, Fon1, Fon2, oPrn, Fon3, Fon4, aPos, aSiz, oDbf, k
SET 3DLOOK OFF
PRINTER oPrn PREVIEW
IF EMPTY( oPrn:hDC )
RETURN NIL
ENDIF
aPos:=oPrn:Cmtr2Pix(1.50,11.5)
aSiz:=oPrn:Cmtr2Pix(12.5, 4.5)
oPrn:SetPage( 2 ) // 1=Papel Letter 8 1/2 x 11 in / 9=A4 210 x 297 mm
DEFINE FONT Fon1 NAME "Consolas" SIZE 0,-10
DEFINE FONT Fon2 NAME "Consolas" SIZE 0,-12 BOLD
DEFINE FONT Fon3 NAME "Consolas" SIZE 0,-10 BOLD
DEFINE FONT Fon4 NAME "Consolas" SIZE 0,-8
SELECT PA25 ; DBGOTOP()
REPORT oRpt TITLE " "," ","INFORME PROCESO DE PACKING N° "+PA18->NPRO+" - "+DTOC(PA18->FECH),"EMPRESA : "+ALLTRIM(PA18->LOTE),"PRODUCTOR : "+ALLTRIM(PA18->CCSG)+"-"+ALLTRIM(PA18->NOMB),"ESPECIE : "+PA18->ESPE+"-"+ALLTRIM(PA18->NOME),"VARIEDAD : "+PA18->VARI+"-"+ALLTRIM(PA18->ETIQ)," "," "," "," "," "," "," "," "," "," "," " LEFT ;
HEADER oGraph:Print(oPrn,aPos[1],aPos[2],aSiz[1],aSiz[2]), SPACE(16)+oApp:cEmpresa, SPACE(16)+ALLTRIM(oApp:cDireccion)+" / "+ALLTRIM(oApp:cCiudad)+" / "+ ALLTRIM(oApp:cTelefono) ;
FOOTER ALLTRIM(oApp:cSigEmp)+" "+oApp:cRut+" Página Nro : "+STR(oRpt:nPage,3,0)+" ( Fecha :"+DTOC(ServerDate())+" Hora : "+SUBSTR(ServerTime(),1,5)+" )",__MAIN+" "+__VERSION+oApp:cVersion+" Proc.: ["+MAINPRO+" ver."+VERSIONPRO+"]" CENTER ;
FONT Fon1, Fon2, Fon3, Fon4 ;
TO DEVICE oPrn ;
CAPTION "CierreProceso"
COLUMN TITLE "Lotes" ,"Procesados" DATA "Lote : "+PA25->LOTE FONT 1 SIZE 20 CENTER GRID
COLUMN TITLE " " ,"Recepción" DATA PA25->FECH FONT 1 SIZE 12 CENTER
COLUMN TITLE "Total" ,"Bins" DATA PA25->ESTA PICTURE "@E 9,999.99" FONT 1 SIZE 12 TOTAL GRID
COLUMN TITLE "Total" ,"Totems" DATA PA25->MINU PICTURE "@E 9,999.99" FONT 1 SIZE 12 TOTAL GRID
COLUMN TITLE "Kilos" ,"Vaciados" DATA PA25->TUN1 PICTURE "@E 99,999.99" FONT 1 SIZE 12 TOTAL GRID
COLUMN TITLE " " ,"% PT&I" DATA PA25->TUN3 PICTURE "@E 999.99" FONT 1 SIZE 10 GRID
COLUMN TITLE " " ," " DATA PA25->ID FONT 1 SIZE 1 GRID
COLUMN TITLE " " ,"Observaciones" DATA PA25->ID FONT 1 SIZE 40 GRID
END REPORT
IF oRpt:lCreated
oRpt:lJoin := .T.
oRpt:lAutoland := .T.
oRpt:lColTitleShadow := .T.
oRpt:nColTitleClrShadow := _CLRREPTX3
oRpt:bInit := {|| PA25->(dbGotop()) } <<--- :bInit con un valor se puede usar el boton para exportar a excel
oRpt:SetPenColor( CLR_BLUE )
oRpt:cGrandTotal := "Integridad de Datos"
oRpt:Stabilize()
ENDIF
ACTIVATE REPORT oRpt ON STARTPAGE CabezeraProceso( oRpt )
STATIC FUNCTION CabezeraProceso( oRpt )
LOCAL cText := "", nLine, nStep, nTot, n, oBr
DEFINE BRUSH oBr COLOR nRGB(255,179,128)
oRpt:SayBitmap(0.30, 0.30,".\SYSTEM\RE000.Bmp") <<---- imagen
nLine := ROUND(( oRpt:oDevice:nVertRes() / 11 ),0)
nStep := ROUND(( nLine / 6.90 ), 0)
nTot := {0,0,0,0,0,0}
n := Int( oRpt:oPenHorz:nWidth * 5 )
SetbkMode( oRpt:oDevice:hDCOut, 1 )
nTot[1] := ( oApp:aPorcen[2] / oApp:nSumas ) * 100
nTot[2] := ( oApp:aPorcen[5] / oApp:nSumas ) * 100
nTot[3] := oApp:nSumas - ( oApp:aPorcen[2] + oApp:aPorcen[5] )
nTot[4] := oApp:aPorcen[1] + oApp:aPorcen[4]
nTot[5] := ( nTot[3] / oApp:nSumas ) * 100
nTot[6] := nTot[1] + nTot[2] + nTot[5]
nLine += ( nStep * 5 )
oRpt:oDevice:FillRect( { nLine + n, oRpt:aCols[1] - 10, nLine + ( oRpt:nStdLineHeight * oRpt:nMaxTitle ) + n * 3 , oRpt:aCols[4] + oRpt:aColumns[4]:nWidth + 100}, oBr )
nLine += nStep
oRpt:oDevice:Line( nLine-60 , 470, nLine-60 , 3000 )
oRpt:Say( 3, "RESULTADO DE PROCESO", 2, RPT_CENTER, nLine ) ; nLine += nStep
oRpt:Say( 2, "Envases" , 3, RPT_CENTER , nLine )
oRpt:Say( 3, "Kilos" , 3, RPT_CENTER , nLine )
oRpt:Say( 4, "%" , 3, RPT_RIGHT , nLine ) ; nLine += nStep
oRpt:oDevice:Line( nLine+20 , 470, nLine+20 , 3000 )
nLine += ( nStep / 2 )
oRpt:Say( 1, "Exportable", 1, RPT_LEFT , nLine ) ; oRpt:Say( 2,TRANSFORM(oApp:aPorcen[1],"@E 99,999"), 1, RPT_RIGHT, nLine) ; oRpt:Say( 3,TRANSFORM(oApp:aPorcen[2],"@E 99,999.99"), 1, RPT_RIGHT, nLine) ; oRpt:Say( 4,TRANSFORM(nTot[1],"@E 999.99"), 1, RPT_RIGHT, nLine) ; nLine += nStep
oRpt:Say( 1, "Comercial" , 1, RPT_LEFT , nLine ) ; oRpt:Say( 2,TRANSFORM(oApp:aPorcen[4],"@E 99,999"), 1, RPT_RIGHT, nLine) ; oRpt:Say( 3,TRANSFORM(oApp:aPorcen[5],"@E 99,999.99"), 1, RPT_RIGHT, nLine) ; oRpt:Say( 4,TRANSFORM(nTot[2],"@E 999.99"), 1, RPT_RIGHT, nLine) ; nLine += nStep
oRpt:Say( 1, "Mermas" , 1, RPT_LEFT , nLine ) ; oRpt:Say( 3,TRANSFORM(nTot[3] ,"@E 99,999.99"), 1, RPT_RIGHT, nLine) ; oRpt:Say( 4,TRANSFORM(nTot[5],"@E 999.99"), 1, RPT_RIGHT, nLine) ; nLine += nStep
nLine += ( nStep / 2 )
oRpt:oDevice:Line( nLine , 470, nLine , 3000 )
oRpt:oDevice:Line( nLine+100 , 470, nLine+100, 3000 )
oRpt:Say( 1, "Totales" , 3, RPT_LEFT , nLine ) ; oRpt:Say( 2,TRANSFORM(nTot[4] ,"@E 99,999"), 3, RPT_RIGHT, nLine) ; oRpt:Say( 3,TRANSFORM(oApp:nSumas ,"@E 99,999.99"), 3, RPT_RIGHT, nLine) ; oRpt:Say( 4,TRANSFORM(nTot[6],"@E 999.00"), 3, RPT_RIGHT, nLine) ; nLine += nStep
oRpt:Say( 6, "KILOS VACIADOS" , 2, RPT_LEFT , nLine )
oBr:End()
RETURN .T.