Code: Select all
TELE0060->(DbSetOrder(3))
TELE0060->(dbSeek(vDataini))
DO WHILE TELE0060->(!eof()) .AND. TELE0060->A_DTPED_60 >= vDataini .and. TELE0060->A_DTPED_60 <= vDataFin
IF TELE0060->A_STATUS60 == 'C'
TELE0060->(dbSkip())
Loop
ENDIF
aadd(a_show,{TELE0060->A_TOTAL_60, TELE0060->A_DESC__60, TELE0060->A_DESBAL60, TELE0060->A_VLRPRO60, TELE0060->A_TXENT_60,;
TELE0060->A_DTPED_60, TELE0060->DESC_DINHE})
TELE0060->(dbSkip())
ENDDO
I:= 1 ; nHasta := LEN( a_show)
REPORT oReport ;
TITLE OemToAnsi("*** RELATORIO DE VENDAS ***"),"Relatorio Interno","Referente a " + Dtoc(vDataIni) + space(1) +;
OemToAnsi("ate") + space(1) + Dtoc(vDataFin),"","" CENTERED;
FONT oFont1, oFont2, oFont3 ;
HEADER "Data: " + Dtoc(date()) + " " + time() CENTERED ;
FOOTER OemToAnsi("Pagina: ")+str(oReport:nPage,3) CENTERED;
PREVIEW
COLUMN TITLE OemToAnsi("Num") ;
DATA transform(I,'@E 999');
SIZE 3
COLUMN TITLE OemToAnsi("Data") ;
DATA a_show[I,6];
SIZE 10
COLUMN TITLE "Faturamento" ;
DATA a_show[I,1];
TOTAL
COLUMN TITLE "Descontos" ;
DATA a_show[I,2];
TOTAL
COLUMN TITLE "Desc. Balcao" ;
DATA a_show[I,3];
TOTAL
COLUMN TITLE "Desc. Promo" ;
DATA a_show[I,4];
TOTAL
COLUMN TITLE "Desc. Dinh." ;
DATA a_show[I,7];
TOTAL
COLUMN TITLE "Taxa de Entrega" ;
DATA a_show[I,5];
TOTAL;
GRID
GROUP ON a_show[6]; //esta es la fecha
HEADER oReport:aGroups[1]:cValue;
FOOTER "Pedidos: " + "[" + Alltrim(str(oReport:aGroups[1]:nCounter)) + "]"
END REPORT
oReport:CellView() //FORMA AS LINHAS VERTICAIS E HORIZ DAS CELDAS
oReport:bWhile := { || I <= nHasta }
oReport:bSkip := { | | I++}
oReport:cGrandTotal := "Grand Total..."
oReport:cPageTotal := "Page Total..."
oReport:oTitle:aFont[2] := {|| 2 } //1ra linha do titulo