Dear Expert, With the help of sample code i am trying to make a monthly Outstanding report of Debtors using columnar approach, But i will not the get the closing balance can any one help mee? [#Menu: Gateway of Tally] Add : Item : Before : @@locquit : OUTSTANDING REPORT : Display : Sample Report [Report: Sample Report] ;Use : DSP Template Variable : SV From Date, SV To Date Repeat : SVFromDate, SVToDate Form : SampleForm Column Report : ChangePeriod Variable : GroupName [Form: Sample Form] Use : DSP Template Parts : ReportTitle, ReportDetail Background : Very Light Sea Green Add:Button:btn1 [Part: Report Title] Lines : Title1 [Line: Title1] Fields : SrNoFld, LedNameFld, LedFld Repeat : LedFld Local : Field : Default : Type : String Local : Field : Default : Align : Centre Local : Field : Default : Style : Normal Bold Local : Field : SrNoFld : Set As : " Sr No" Local : Field : LedNameFld: Set As : "Name of Account" Local : Field : LedFld : Set As : @@DSPDateStr Local : Field : LedFld : Lines : 0 Border : Thin Top Bottom [Part: Report Detail] Lines : DetailLine Repeat : DetailLine : ExtractParty Coll ;;Ledger ;;ExtractSampleColl Scroll : Vertical Total : LedQtyFld Common Border : Yes Float : Yes ;Background:Red [Line: DetailLine] Fields : SrNoFld, LedNameFld, LedFld Repeat : LedFld [Field: SrNoFld] Set As : $$Line Width : 15 mms Border : Thin Right [Field: LedNameFld] Set As : $LedgerName Width : 100 mms QuickSearch : Yes [Field: LedFld] Width : 20 mms Border : Thin Left Right Set As : $$FucToCompute@DSPFromDate@DSPToDate ;Background:yellow [Collection: Vouchers Coll] Type : LEDGER Child Of:$$GroupSundryDebtors ;Fetch : InventoryEntries.*, Date, PartyLedgerName Parm Var : SV To Date : $$Date:"31-03-2014" [Collection: ExtractParty Coll] Source Collection : Vouchers Coll By : LedgerName : $NAME [Collection: ExtractSampleColl] Source Collection : Vouchers Coll By : StrDate : $$String:$Date By : LedgerName : $NAME Compute : InvAmt : $CLOSINGBALANCE Search Key : $LedgerName + $StrDate ;; SELECT $LedgerName , $InvAmt FROM ExtractSampleColl [Function: FucToCompute] Parameter : PSVFromDate : Date Parameter : PSVToDate : Date Variable : TotalVal : Amount Variable : Temp Date : Date Variable : SearchKey : String RETURNS : Amount 10 : SET : TotalVal : 0 20 : SET : TempDate : ##PSVFromDate 30 : WHILE : (##TempDate <= ##PSVToDate) 40 : SET : SearchKey : #LedNameFld + $$String:##TempDate 50 : SET : TotalVal : $$ReportObject:$$CollectionFieldByKey:$InvAmt:##SearchKey:ExtractSampleColl ;+ ##TotalVal 60 : SET : TempDate : ##TempDate + 1 70 : END WHILE 80 : RETURN : ##TotalVal [Button:btn1] Title:"SHOW MONTHLY" Key:alt+z Action:Trigger Key:Alt+n,m,enter,enter
in this query if you had large database of list of ledger or whatever ur sequencial condition is before must be @ DATE range to run this function... hance latest system with latest version getting so more time to execute it. so update CODEs.
Very Good. Also try to get AutoColumn on opening the report, rather than using a button. Use --- DoSetAutoColumn -- you can study that in the Developer.
search for "$$collectionfieldbykey" in developer............. and learn how it is to be used. It can be used in multiple ways...as per your choice, requirement and code structure.