;; Sri Ganeshji : Sri Balaji : Sri Pitreshwarji : Sri Durgaji : Sri Venkateshwara /* - This program illustrates the use of following attributes of progress bar Activity Name Context Note ProcessName ProgressIndication Stages Subcontext Total Count About this program - This program creates stockitems in 4 stages with 100 stockitems in each stage */ [#Menu: Gateway of Tally] Add : Item : ($$LocaleString:"Simple ProgressBar Demo") : Display : TSPL Simple Progress Report [Report: TSPL Simple Progress Report] Title : $$LocaleString:"Simple Progress Bar Demo" Form : TSPL Simple Progress Form [Form: TSPL Simple Progress Form] Parts : TSPL Simple Info Part Buttons : TSPL Start Progress Button Height : 10% Screen Width : 30% Screen [Part: TSPL Simple Info Part] Lines : TSPL Simple Info Line [Line: TSPL Simple Info Line] Fields : TSPL Simple Info Field [Field: TSPL Simple Info Field] Set as : $$LocaleString:"Press F5 to start the Progress Bar demonstration." Style : Normal Bold [Button: TSPL Start Progress Button] Key : F5 Title : $$LocaleString:"Start Progress" Action : Call: TSPL Start Progress Function [Progress Bar: TSPL Simple Progress Bar] Activity Name : Creating Stock Items (400 Nos) Context : Stock Item Creation SubContext : Demonstration Note : This Might Take Sometime! Total Count : 100 Stages : Stage-1 (0 - 100), Stage-2 (101 - 200), Stage-3 (201 - 300), Stage-4 (301 - 400) ProcessName : "Creating Items" Progress Indication : $$SPrintf:"Items Created : %s":##StkItemcount [Function: TSPL Start Progress Function] Parameter : NumOfObjects : Number: 100 ;; After every 100 items, move to the next step. Variable : Counter : Number Variable : StkItemcount : Number: 0 Returns : Number Local Formula : StockitemName : "StockItem" + ($$String:##StkItemcount) ;; Hardcoded stock item name. 10: Initialize ProgressBar: TSPL Simple Progress Bar ;; This action is used to Start progress bar. 20: FOR RANGE : vStageCount : Number : 1 : 4 30: ProgressBar Set Active Stage : ##vStageCount ;; This action is used to set the active stage. 40: ProgressBar Update TotalCount : 100 50: While : ##Counter < ##NumOfObjects 60: If : $$IsEmpty:$Name:Stockitem:@StockitemName 70: New Object : Stockitem 80: Else : 90: New Object : Stockitem : @StockitemName 100: End If 110: Set Value : Name : @StockitemName 120: Set Value : BaseUnits : "Nos" 130: Save Target 140: Increment : Counter ;; Increasing the item count to 400 items. 150: Increment : StkItemcount 160: ProgressBar Set ItemsDone : ##Counter ;; This action is used to set the number of steps completed in the task. 170: ProgressBar Update Progress Indication : $$Sprintf:"%s %s":("Created :"):##StkItemcount;; This action is used to set Progress indication to be displayed in progress bar window. 180: End While 190: Increment: vStageCount 200: Set: Counter : 0 210: End For 220: Finalize ProgressBar ;; When a task is completed, Progress Bar will be stopped by using action Finalize ProgressBar. 225: Msg Box: "Status": ("Created " + ($$String:##StkItemcount)+" Stockitems") ;;EOF