Luiz Arruda (ICO) Posted May 19, 2005 Report Share Posted May 19, 2005 Ola a todos. gostaria que se possivel, alguem desse uma olhada neste codigo, ( eu compilava no clipper e funcionava) GOSTARIA QUE FOSSE TRANSFORMADO PARA FW. SAL :=TRANSPORTE // MES ANTERIOR USE DIARIO INDEX DATASX PG :=0 // NUMERO DA PAGINA CABECA := "S" DO WHILE .NOT. EOF() IF CABECA := "S" PG=PG+1 @PROW()+1,02 SAY NOMEDAEMPRESA @PROW()+1,02 SAY ENDERECO @PROW(),50 SAY "FOLHA "+TRANSFORM(PG,"999") @PROW()+2,02 SAY "|DATA| HISTORICO |PAGAMENTO | RECEBIMENT | SALDO EM CONTA|" ENDIF CABECA :="N" @PROW()+1,02 SAY DATA @PROW(),12 SAY HISTORICO IF PR="P" // SE LANCAMENTO FOI (P)-PAGAMENTO COL:=50 // VALOR SERA IMPRESSO NA COLUNA 50 J=-1 ELSE COL:=75 // SE LANCAMENTO FOR ®-RECEBIMENTO VALOR IMPRESSO NA 75 J=1 ENDIF @PROW(),COL SAY VALOR PICT "99,999.99" // SE PR FOR=P - VALOR SAI NA COLUNA 50 SE FOR R NA COLUNA 75 SAL:=SAL+VALOR*J // CALCULA O SALDO ATUAL @PROW(),85 SAY SAL PICT "99,999.99" // NA COLUNA 85 SAY O SALDO ATUALIZADO IF PROW()>55 // SE IMPRIMIR MAIS DE 54 LINHAS EJECT // EJETA A FOLHA CABECA:="S" // VOLTA NO CABEÇALHO ENDIF SKIP ENDDO // VOLTA NA PROXIMA LINHA SET DEVI TO SCREE EJECT OBRIGADO ICO Quote Link to comment Share on other sites More sharing options...
marcelo Posted May 19, 2005 Report Share Posted May 19, 2005 Ola Ico Voce pode usar as classes report ou tprinter para os seus relatórios ou a função tdosprn. Exemplos da Classe Tprinter voce encontra em fw??\samples\testpr*.prg e da Classe Report em fw??\samples\report\rep*.prg A função postada por voce eu faria o relatório usando Report *** # include 'fivewin.ch' # include 'report.ch' Function main imprime() return(0) Function imprime() LOCAL oFont1, oFont2, oFont3, oPen1, oPen2 DEFINE FONT oFont1 NAME "ARIAL" SIZE 0,-10 DEFINE FONT oFont2 NAME "ARIAL" SIZE 0,-10 BOLD DEFINE FONT oFont3 NAME "ARIAL" SIZE 0,-10 BOLD ITALIC DEFINE PEN oPen1 WIDTH 3 COLOR CLR_HGREEN DEFINE PEN oPen2 WIDTH 1 COLOR CLR_HMAGENTA NN=1 USE dIARIO INDEX WDATAX GO TOP array:={} SAL=0 DO WHILE !EOF() wpag:=wrec:=0 if pr='p' wpag=valor j=-1 else wrec=valor j=1 endif SAL=SAL+VALOR*j AADD(aarray,{data,historico,wpag,wrec,sal}) skip enddo if len(aarray)<1 return(nil) endif REPORT oReport ; TITLE "*** Empresa Tal ***",; "",; OemtoAnsi("Endereço Tal"),; "" ; FONT oFont1,; oFont2,; oFont3 ; PEN oPen1,; oPen2 ; HEADER "Date: "+dtoc(date()),; "Time: "+time() ; RIGHT ; FOOTER OemtoAnsi("Page: ")+str(oReport:nPage,3) ; CENTERED ; PREVIEW COLUMN TITLE "Data ; DATA aarray[nn][1]; FONT 2 ; GRID 2 COLUMN TITLE "Histórico" ; DATA aarray[nn][2]; GRID 2 COLUMN TITLE "Pagamento" ; DATA aarray[nn][3]; GRID 2 COLUMN TITLE "Recebimento" ; DATA aarrray[nn][4] ; PICTURE '9,999.99' GRID 2 COLUMN TITLE " Total" ; DATA aarray[nn][5]; PICTURE '9,999.99' ; SHADOW ; GRID END REPORT oReport:bSkip:={|| NN++} ACTIVATE REPORT oReport oFont1:End() oFont2:End() oFont3:End() oPen1:End() oPen2:End() CLOSE diario RETURN NIL Testa e ve se da certo Yrece Quote Link to comment Share on other sites More sharing options...
Luiz Arruda (ICO) Posted May 20, 2005 Author Report Share Posted May 20, 2005 Ola. Marcelo obrigado por responder, olha seu exemplo funcionou, só que no preview e no papel aparece somente as colunas desenhadas, deixando de aparecer os lancamentos registrados no arquivo. mais uma vez obrigadão ICO Editado por - ico on 20/05/2005 09:13:29 Quote Link to comment Share on other sites More sharing options...
marcelo Posted May 20, 2005 Report Share Posted May 20, 2005 Ola Verifique se esta abrindo direito o seu banco de dados.Eu coloquei de acordo como voce abre seus arquivos.Se quiser tentar assim: Sele 1 Use Diario Set order to ?? Go top ******************************* onde coloquei array:={} mude para aarray:={} Yrece Quote Link to comment Share on other sites More sharing options...
Luiz Arruda (ICO) Posted May 20, 2005 Author Report Share Posted May 20, 2005 Boa Tarde infelizmente nao esta dando certo, as colunas aparecem e imprimem todas certinhas, só que sem os registros dentro. ICO - Corumba/MS iko67@ibest.com.br Editado por - ico on 20/05/2005 17:51:41 Quote Link to comment Share on other sites More sharing options...
marcelo Posted May 20, 2005 Report Share Posted May 20, 2005 Ola Mande seu dbf por email trench@protestodeosasco.com.br e continua sua pescaria Yrece Quote Link to comment Share on other sites More sharing options...
Luiz Arruda (ICO) Posted May 20, 2005 Author Report Share Posted May 20, 2005 OLA. Enviei o DBF p/ seu email obrigadao de novo. ICO - Corumba/MS iko67@ibest.com.br Quote Link to comment Share on other sites More sharing options...
Luiz Arruda (ICO) Posted May 21, 2005 Author Report Share Posted May 21, 2005 Ola. o exemplo que vc. me enviou por email, esta perfeito exatamente como eu queria. abraços e até a próxima ICO - Corumba/MS iko67@ibest.com.br 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.