;; Sri Ganeshji : Sri Balaji : Sri Pitreshwarji : Sri Durgaji : Sri Venkateshwara

/*
Objective(s)  
- 	This code demonstrates the usage of Field Acting as Variables
- 	The Variable value keeps changing when the user displays the report and
	scrolls over lines. The variable value will always assume the current line's
	Field Value.  This helps for viewing drill down reports and tracking user's
	choice.  The subsequent report uses the current field acting as variable value
	to display the report.
-	Variables are by default, Volatile in nature.
*/

[#Menu: Gateway of Tally]

	Add	: Item	: Before : @@locQuit	: FAAV Report		: Display	: FAAV Report
    
[Report: FAAV Report]

	Form		: FAAV Report
	Variable	: FAAV Group Name	: String   ;;;variable defined at the report level
	
[Form: FAAV Report]

	Parts		: FAAV Report

[Part: FAAV Report]

	Lines		: FAAV TB Title, FAAV TB Details
	Repeat		: FAAV TB Details	: FAAV TB Collection     ;;;Repeating the line on the collection of groups
	Scroll		: Vertical
	CommonBorder: Yes

	[Line: FAAV TB Title]

		Use		: FAAV TB Details
		Local	: Field		: Default			: Type		: String
		Local	: Field		: Default			: Align		: Center

		Local	: Field		: FAAV TB Name		: Set As	: "Name"
		Local	: Field		: FAAV TB Closing	: Set As	: "Closing Balance"
		Border	: Thin Top Bottom

	[Line: FAAV TB Details]

		Fields		: FAAV TB Name
		Right Fields: FAAV TB Closing

		[Field: FAAV TB Name]

			Use			: Name Field
			Set As		: $Name               ;;; setting the group name in the field
			
			Option		: FAAV TB Grp	: $$IsGroup
			
			[!Field: FAAV TB Grp]
				
				Variable	: FAAVGroupName      ;;;Capture the current field value in the variable
				Display		: FAAV Report

		[Field: FAAV TB Closing]

			Use			: Amount Forex Field
			Set As		: $ClosingBalance           ;;setting the closing value in the field
			Border		: Thin Left

[Collection: FAAV TB Collection]

	Type		: Group
	Child Of	: #FAAVGroupName        ;; Collection displays all the sub group of the main group passed as variable value
	Fetch		: Name, ClosingBalance ;; Required for fetching values for remoting

;; End-of-File
