daniel_halon Posted September 13, 2016 Report Share Posted September 13, 2016 Olá amigos, preciso de uma ajuda, uso Treport do fw mas não consigo usar o group, aqui esta o fonte, sera que alguem pode me dizer o que esta errado? 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]; //data 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 Quote Link to comment Share on other sites More sharing options...
kapiaba Posted September 13, 2016 Report Share Posted September 13, 2016 // This is a demo of the FiveWin report Engine #include "FiveWin.ch" #include "report.ch" #define BLANCO 1 #define ROJO 2 #define AMARILLO 3 #define AZUL 4 #define VERDE 5 static oWnd //----------------------------------------------------------------------------// Function Main() LOCAL oBar FIELD State, City USE Customer INDEX ON State+City TO CustStCt SET INDEX TO CustStCt DEFINE WINDOW oWnd TITLE "FiveWin Report Engine demo" MDI DEFINE BUTTONBAR oBar OF oWnd DEFINE BUTTON OF oBar ACTION DoReport() ACTIVATE WINDOW oWnd return nil //----------------------------------------------------------------------------// function DoReport() local oReport REPORT oReport ; TITLE "*** LISTADO DE PRUEBA ***","","FiveTech Software","" ; HEADER "Fecha: "+dtoc(date())+space(44)+"Hora: "+time() ; FOOTER "P gina: "+str(oReport:nPage,3) /* GROUP ON Customer->State ; HEADER "Header " ; FOOTER "Total Estado "+oReport:aGroups[1]:cValue */ GROUP ON Customer->State ; HEADER "Header: " + oReport:aGroups[1]:cValue ; FOOTER "Total Estado "+ "[" + ALLTRIM( STR( oReport:aGroups[1]:nCounter ) ) + "]" /* GROUP ON a_show[6]; //data HEADER oReport:aGroups[1]:cValue; FOOTER "Pedidos: " + "[" + Alltrim(str(oReport:aGroups[1]:nCounter)) + "]" */ COLUMN TITLE "ST" ; DATA Customer->State COLUMN TITLE "City" ; DATA Customer->City ; SIZE 30 COLUMN TITLE "First Name","Last Name" ; DATA Customer->First, Customer->Last ; SIZE 30 COLUMN TITLE " Salary" ; DATA Customer->Salary ; PICTURE "9,999,999" ; SIZE 9 ; TOTAL END REPORT // Color para lineas en verde // oReport:bStdFont := {|| VERDE } //Color para totales de cuarta columna en AZUL // oReport:aColumns[4]:bTotalFont := {|| AZUL } //Header y Footer en azul // oReport:oHeader:aFont[1] := {|| AZUL } // oReport:oFooter:aFont[1] := {|| AZUL } // Titulo, header y Footer de grupo en amarillo // oReport:oTitle:aFont[1] := {|| AMARILLO } // oReport:aGroups[1]:bHeadFont :={|| AMARILLO } // oReport:aGroups[1]:bFootFont :={|| AMARILLO } ACTIVATE REPORT oReport ; ON STARTPAGE Tone( 100, 1 ) RETURN NIL //----------------------------------------------------------------------------// Quote Link to comment Share on other sites More sharing options...
daniel_halon Posted September 13, 2016 Author Report Share Posted September 13, 2016 Oi Kapi, obrigado por responder mas não sei se chegaste a perceber que não estou usando base de dados, carrego tudo em um array para ser mais rápido em rede, as outras funções em uso bd funciona ok, mas o group com array não consigo, sera que tens algum exemplo por ai dentro do teu baú? Quote Link to comment Share on other sites More sharing options...
kapiaba Posted September 13, 2016 Report Share Posted September 13, 2016 http://forums.fivetechsupport.com/viewtopic.php?f=6&t=14876&p=80519&hilit=HEADER+oReport%3AaGroups#p80519 Quote Link to comment Share on other sites More sharing options...
daniel_halon Posted September 13, 2016 Author Report Share Posted September 13, 2016 Tentei mas não deu certo, deve ter alguem que tenha resolvido Quote Link to comment Share on other sites More sharing options...
aferra Posted September 14, 2016 Report Share Posted September 14, 2016 bom eu não sei se tem mais velocidade com array do que com dbf, eu uso para relatórios dbf temporarios e funciona muito bem, tente isso já que com dbf funciona. ou tente assim, nunca fiz com array é um chute GROUP ON a_show[I,6]; //data Quote Link to comment Share on other sites More sharing options...
daniel_halon Posted September 14, 2016 Author Report Share Posted September 14, 2016 oi Aferra, obrigado pelo interesse, desta forma da erro GROUP ON a_show[I,6], o Kapi postou un link que falava de erro na classe, e bem provável mas acho que vou seguir teu conselho, carrego em um array e passo para uma dbf temporária, a intenção de trabalhar com array e porque em rede quando consulta em uma bd grande os terminais demoram muito para processar e notei que com array diminui o tempo em 90%. Obrigado, Valeu! Quote Link to comment Share on other sites More sharing options...
ADutheil Posted September 14, 2016 Report Share Posted September 14, 2016 A dice de aferra deve funcionar. Segue uma linha que uso em 1 dos meus sistemas: GROUP ON aShow[ nI, 2 ] FOOTER PegaNomRota( oRepo:aGroups[ 1 ]:cValue ) FONT 2 EJECT Quote Link to comment Share on other sites More sharing options...
kapiaba Posted September 14, 2016 Report Share Posted September 14, 2016 http://forums.fivetechsupport.com/viewtopic.php?f=6&t=32951 Quote Link to comment Share on other sites More sharing options...
aferra Posted September 14, 2016 Report Share Posted September 14, 2016 veja bem, vc vai usar o dbf tmp no lugar do array e não fazer um array e depois dbf tmp, tudo vc faz igual usando o tmp é muito bom pois os comando são iguais e velocidade muito boa. mesmo com rel´s grandes... Theotokos 1 Quote Link to comment Share on other sites More sharing options...
Theotokos Posted September 14, 2016 Report Share Posted September 14, 2016 veja bem, vc vai usar o dbf tmp no lugar do array e não fazer um array e depois dbf tmp, tudo vc faz igual usando o tmp é muito bom pois os comando são iguais e velocidade muito boa. mesmo com rel´s grandes... oi, vc pode postar um exemplo? interessei em conhecer isto!!! obgdão!!! Quote Link to comment Share on other sites More sharing options...
aferra Posted September 15, 2016 Report Share Posted September 15, 2016 rapaz, exemplos aos montes no próprio forum, procure por Hb_DbCreateTemp Quote Link to comment Share on other sites More sharing options...
daniel_halon Posted September 18, 2016 Author Report Share Posted September 18, 2016 Obrigado a todos pelo interesse, não consegui fazer funcionar o group com array, a solução foi mesmo criar uma bd temporária e ficou rápido tambe ém. Abraços Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.