Account : ABC ----------------------------------------------------------------------------------- Dr.Date Dr.Vno Dr.Amount | Cr.Date Cr.Vno Cr.Amount ----------------------------------------------------------------------------------- 01.04.2007 101 5000.00 | 05.04.2007 15 3000.00 01.04.2007 102 2000.00 | 05.04.2007 16 1000.00 01.04.2007 103 3000.00 | 05.04.2007 17 1000.00 ----------------------------------------------------------------------------------- Dr.Total 10000.00 | Cr.Total 5000.00 -----------------------------------------------------------------------------------i have my dbf (ledger.dbf) like this :
accode c (7) date d vno n (10) type c (1) amount n (10,2)i am using code like this to create the report
create table templedger ; (accode c(7), drdate d, drvno n(10), dramt n(10,2), crdate d, crvno n(10),cramt n(10,2), nn c(1)) sele templedger inde on accode tag acnn inde on accode+nn tag acnn sele * from ledger where type='D' into curs tdled sele tdled goto top do while !eof() sele templedger appe blank repl accode with tdled.accode, drdate with tdled.date, drvno with tdled.vno, ; dramt with tdled.amt in templedger sele tdled skip enddo sele templedger set order to accnn sele * from ledger where type='C' into curs tcled sele tcled goto top do while !eof() sele templedger mkey=tcled.accode+' ' if not seek(mkey,'templedger','accnn') appe blank repl accode with tcled.accode, crdate with tcled.date, crvno with tcled.vno, ; cramt with tcled.amt in templedger endif repl nn with 'Y' sele tcled skip enddo sele templedger set order to accode goto top report form ledger to print prompt previewwarm regards,