Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Report like this
Message
 
 
À
29/04/2007 04:36:37
Mk Sharma
Shrishti Solutions
Mumbai, Inde
Information générale
Forum:
Visual FoxPro
Catégorie:
Gestionnaire de rapports & Rapports
Divers
Thread ID:
01220871
Message ID:
01220924
Vues:
15
Try
SELECT accode, 0000000 AS asq, ;
		date AS drdate, vno as drvno, amount AS dramt ;
	FROM ledger WHERE type = 'D' ;
	ORDER BY 1,3 ;
	INTO CURSOR tdled READWRITE
= FillAsq()
SELECT accode, 0000000 AS asq, ;
		date AS crdate, vno as crvno, amount AS cramt ;
	FROM ledger WHERE type = 'C' ;
	ORDER BY 1,3 ;
	INTO CURSOR tcled READWRITE
= FillAsq()

SELECT ;
		NVL(dr.accode, cr.accode) AS account, ;
		dr.drdate, dr.drvno, dr.dramt, ;
		cr.drdate, cr.drvno, cr.dramt ;
	FROM tdled dr ;
		FULL OUTER JOIN tcled cr ;
			ON dr.accode = cr.accode AND dr.asq = cr.asq
RETURN 

PROCEDURE FillAsq
GO TOP
DO WHILE NOT EOF()
	lcAccode = accode  
	lnAsq = 0
	SCAN WHILE accode = lcAccode
		lnAsq = lnAsq + 1
		REPLACE asq WITH lnAsq	
	ENDSCAN
ENDDO
RETURN
>how to create fast reports like this :
>
>this report takes long time if i have so many accounts (if i have 1000 accounts) to generate the report.
>
>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
<snip>
--sb--
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform