Luiz Arruda (ICO) Posted September 17, 2013 Report Share Posted September 17, 2013 Boa Tarde Muito pouco sei usar o report, agora preciso de um relatorio simples , como faço uma condição IF para separar colunas ??? Exemplo O arquivo DBF tem os campos Data Historico D_c Valor Eu quero jogar o valor D em uma coluna e o C em outra + - assim COLUMN TITLE "DATA" DATA CAIXA->DATA COLUMN TITLE "HISTORICO" DATA CAIXA->HISTORICO If DC="D" Col=50 na coluna 50 sair impreso o valor do débito COLUMN TITLE " VALOR" DATA CAIXA->VALOR Else Col=75 Endif na coluna 75 sair impresso o valor do credito COLUMN TITLE " VALOR" DATA CAIXA->VALOR pra ficar assim Data Historico Debito Credito Saldo 01/01 Teste 1 10,00 10,00- 02/01 Teste 2 20,00 10,00 Obrigado... Quote Link to comment Share on other sites More sharing options...
atnsoft Posted September 17, 2013 Report Share Posted September 17, 2013 COLUMN TITLE "%" DATA iif(SubStr(aImp[nConta, 01],1,3) != "AGD", Abs((aImp[nConta, 06] / iif(aImp[nConta, 05] = 0,1,aImp[nConta, 05]) -1)*100), 0.0) Size 08 Picture "@E 999,999.9" Right veja se é isso talvez Column Title "teste" Data iif(banco->dc="C", 0, banco->valor) Size 100 Picture "@E 999,999.99" Ve ai, qq tamo aki Quote Link to comment Share on other sites More sharing options...
joaosolution Posted September 17, 2013 Report Share Posted September 17, 2013 Luiz Você terá que colocar dois campos, um em cada coluna na coluna Débito: [iIF(<CAIXA."DC">='D',CAIXA->VALOR,)] na coluna crédito: [iIF(<CAIXA."DC">='C',CAIXA->VALOR,)] Att João Bosco Quote Link to comment Share on other sites More sharing options...
Luiz Arruda (ICO) Posted September 17, 2013 Author Report Share Posted September 17, 2013 Opa.. Quase isso João não to conseguindo é fazer a conta credito debito saldo 100,00 50,00 50,00 Quote Link to comment Share on other sites More sharing options...
joaosolution Posted September 17, 2013 Report Share Posted September 17, 2013 Luiz Desculpe a orelha grande! Você quer que o Fast faça a conta da coluna saldo? Nesse caso eu te sugiro gerar uma table com o resultado e só imprimir depois no fast. Att João Bosco Quote Link to comment Share on other sites More sharing options...
Luiz Arruda (ICO) Posted September 17, 2013 Author Report Share Posted September 17, 2013 Não é no Fast não.. é na Report nativa do FW Quote Link to comment Share on other sites More sharing options...
joaosolution Posted September 18, 2013 Report Share Posted September 18, 2013 Luiz Acredito ser algo +- assim: COLUMN TITLE "DATA" DATA "" COLUMN TITLE "HISTORICO" DATA "" COLUMN TITLE "DEBITO" DATA "" COLUMN TITLE "CREDITO" DATA "" COLUMN TITLE "SALDO" DATA "" ACTIVATE REPORT oReport ON INIT ImpSaldo(oReport) //----------------------------------------------------------------------------- STATIC FUNCTION ImpSaldo( oReport ) Local k nSaldo := 0 CAIXA->( DbGoTop() ) While CAIXA->( !Eof() ) oReport:StartLine() oReport:Say( 1, Dtoc(CAIXA->DATA) ) oReport:Say( 2, CAIXA->HISTORICO ) If CAIXA->DC == "D" oReport:Say( 3, Str(CAIXA->VALOR,12,2) ) nSaldo -= CAIXA->VALOR Else oReport:Say( 4, Str(CAIXA->VALOR,12,2) ) nSaldo += CAIXA->VALOR Endif oReport:Say( 5, Str(nSaldo,12,2) ) oReport:EndLine() CAIXA->( DbSkip( 1 ) ) End Return .T. Att João Bosco Quote Link to comment Share on other sites More sharing options...
Luiz Arruda (ICO) Posted September 20, 2013 Author Report Share Posted September 20, 2013 Valeu esforço João Bosco... resolvi com a tPrinter IF D_C="D" c=-1 DEB=DEB+VALOR oPrn:Charsay(nlin,68,trans(valor,"999,999.99")) else oPrn:Charsay(nlin,83,trans(valor,"999,999.99")) c=1 CRE=CRE+VALOR endif Quote Link to comment Share on other sites More sharing options...
kapiaba Posted September 20, 2013 Report Share Posted September 20, 2013 Tá muito feio este relatório, não dá para melhorar, ou desaprendeu??? kkkkkkkkkkkkkkkkkkkkkk Quote Link to comment Share on other sites More sharing options...
Luiz Arruda (ICO) Posted September 20, 2013 Author Report Share Posted September 20, 2013 Opa .. o que poderia ser mudado ?? já que ai está todo o conteúdo do DBF e a parte superior de identificação eu cortei... aceito sugestões Quote Link to comment Share on other sites More sharing options...
kapiaba Posted September 20, 2013 Report Share Posted September 20, 2013 Que tal colocar a sua cor preferida?? ROSA XICLÉTTYYYY ???? Hum, hãn, heim?? kkkkkkkkkkkkkkkkkkkkkkk Quote Link to comment Share on other sites More sharing options...
Luiz Arruda (ICO) Posted September 20, 2013 Author Report Share Posted September 20, 2013 Você é gay assim o tempo todo, ou é especialmente para o dia de hoje ??? Quote Link to comment Share on other sites More sharing options...
kapiaba Posted September 20, 2013 Report Share Posted September 20, 2013 kkkkkkkkkkkkkkk, hoje é sexta-feira vey!! E eu não sou SÃO PAULINO, nem FLAMENGUISTA!!! KKKKKKKKKKKKKKKKK Luiz Arruda (ICO) 1 Quote Link to comment Share on other sites More sharing options...
joaosolution Posted September 20, 2013 Report Share Posted September 20, 2013 Mas gosta de selinho!!! By Emerson Sheik!! Att João Bosco Luiz Arruda (ICO) 1 Quote Link to comment Share on other sites More sharing options...
kapiaba Posted September 20, 2013 Report Share Posted September 20, 2013 Mas gosta de selinho!!! By Emerson Sheik!! Att João Bosco Selinho é BOM né João??? Luiz Arruda (ICO) 1 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.