;; Sri Ganeshji : Sri Balaji : Sri Pitreshwarji : Sri Durgaji : Sri Venkateshwara /* Objective(s) - This program illustrates the use of following attributes of Field Graph Label Graph Value Graph X Axis Legend Tile Modifies Set By Condition Option Switch */ [#Menu: Gateway of Tally] Add: Item: ($$LocaleString:"Graph Report"): Display: TSPL Funds Graph Report [Report: TSPL Funds Graph Report] ;;setting the initial values of the variables used in the Graph configuration Set : TSPLGraphType : If $$IsEmpty:##TSPLGraphType then $$SysName:Bar else ##TSPLGraphType Set : TSPLGraphColor : If $$IsEmpty:##TSPLGraphColor then "Blue" else ##TSPLGraphColor Set : TSPLGraphValue : If $$IsEmpty:##TSPLGraphValue then "Closing Balance" else ##TSPLGraphValue Set : TSPLLedgerAlter: If $$IsEmpty:##TSPLLedgerAlter then No else ##TSPLLedgerAlter [Form: TSPL Funds Graph Report] Part : TSPL Funds Graph Button : TSPL Configure Graph ;; Graph part (Bar / Line view) [Part: TSPL Funds Graph] Line : TSPL Funds Graph Details Repeat : TSPL Funds Graph Details : TSPL Funds Collection Local : Style : Default : Height : @@SmallSize - 3 Local : Style : Default : Bold : No Graph Type : Yes Graph Style : ##TSPLGraphType Height : 15 Scroll : Vertical Display X Axis Legend : Yes Shorten Y Axis Label : Yes X Axis Label Word Wrap : Yes Enable Graph Cursor : Yes Graph Display Cursor Label : Yes Scroll Indicator Style : Smaller Graph Display Num Rows : 12 [Line: TSPL Funds Graph Details] Field : TSPL Funds Particulars, TSPL Funds Graph value [Field: TSPL Funds Particulars] Use : Name Field Set as : $Name Graph Label : Yes ;;Sets the field value which is the ledger name as the graph label in x axis Option : TSPLGraphLedAlter : ##TSPLLedgerAlter ;;If the configuration to alter ledger is enabled then the option is applied and ledger can be altered from this field [!Field: TSPLGraphLedAlter] ;;Optional field used in option attribute in TSPLFundsParticulars Alter: Ledger [Field: TSPL Funds Graph value] Use : Amount Field Style : Large Bold Set By Condition: ##TSPLGraphValue = "Closing Balance" : $ClosingBalance ;;$Closingbalance is set in the field if the configuration is selected to closing balance Set By Condition: ##TSPLGraphValue = "Opening Balance" : $OpeningBalance ;;$Openingbalance is set in the field if the configuration is selected to opening balance Graph Value : Yes ;;The value is set as graph value based on which the graph is drawn Set Always : Yes ;;To enable field to refresh when variables change Switch: GraphColor : TSPLGraphBlue : ##TSPLGraphColor ="Blue" ;;Switch conditions to specify color of the graph based on the variable set in configuration Switch: GraphColor : TSPLGraphYellow : ##TSPLGraphColor ="Yellow" Switch: GraphLegend : TSPLGraphClosing : ##TSPLGraphValue = "Closing Balance" ;;Switch conditions to specify x-axis title of the graph based on the variable set in configuration Switch: GraphLegend : TSPLGraphOpening : ##TSPLGraphValue = "Opening Balance" ;;Optional fields for switch label GraphColor in field TSPLFundsGraphvalue [!Field: TSPLGraphBlue] Background: First BarGraph Color [!Field: TSPLGraphYellow] Background: Second BarGraph Color ;;Optional fields for switch label GraphLegend in field TSPLFundsGraphvalue [!Field: TSPLGraphClosing] Graph X Axis Legend Title: "Closing Balance" [!Field: TSPLGraphOpening] Graph X Axis Legend Title: "Opening Balance" ;;Button to show the configuration report [Button: TSPL Configure Graph] Title : $$LocaleString:"Configure Graph" Key : Alt+1 Action : Modify Variables: TSPL Graph Config [Report: TSPL Graph Config] Auto : Yes [Form: TSPL Graph Config] Part : TSPL Graph Config [Part: TSPL Graph Config] Line: TSPL Graph Type, TSPL Graph Color, TSPL Graph Value, TSPL Ledger Alter [Line: TSPL Graph Type] Field: Long Prompt, TSPL Graph Type Local: Field : Long Prompt : Info : $$LocaleString:"Graph Type" [Field: TSPL Graph Type] Use : Name Field Set as : ##TSPLGraphType Set Always : Yes Table : DBTypesofGraph Show Table : Always Modifies : TSPL Graph Type ;;The Graph type selected in the field is copied to the system variable which is further used in the part attribute Graph Type of parent report to define the type of graph [Line: TSPL Graph Color] Field: Long Prompt, TSPL Graph Color Local: Field : Long Prompt : Info : $$LocaleString:"Graph Color" [Field: TSPL Graph Color] Use : Name Field Set as : ##TSPLGraphColor Set Always : Yes Table : TSPLGraphColors Show Table : Always Modifies : TSPLGraphColor ;;The Graph Color selected in the field is copied to the system variable which is further used to set the Background attribute of the field in the parent report [Line: TSPL Graph Value] Field: Long Prompt, TSPL Graph Value Local: Field : Long Prompt : Info : $$LocaleString:"Graph Value" [Field: TSPL Graph Value] Use : Name Field Set as : ##TSPLGraphValue Set Always : Yes Table : TSPLGraphValues Show Table : Always Modifies : TSPLGraphValue ;;The Graph value selected in the field is copied to the system variable which is further used in the setbycondition attribue of the field of the parent report [Line: TSPL Ledger Alter] Field: Long Prompt, TSPL Ledger Alter Local: Field : Long Prompt : Info : $$LocaleString:"Alter Ledger from Graph?" [Field: TSPL Ledger Alter] Use : Logical Field Set as : ##TSPLLedgerAlter Set Always : Yes Table : YesNoTable Show Table : On Error Modifies : TSPLLedgerAlter ;;The value selected is set to the system variable which is used to decide whether to enable altering the ledger from the graph in option attribute of field of the parent report ;;System variables used in the configuration report [System: Variable] Variable: TSPLGraphType : String Variable: TSPLGraphColor : String Variable: TSPLGraphValue : String Variable: TSPLLedgerAlter : Logical ;;Table to list the graph color [Collection: TSPLGraphColors] Title : $$LocaleString:"Graph Colors" List Name : "Blue", "Yellow" Format : $Name, 10 ;;Table to list the graph value to be shown [Collection: TSPLGraphValues] Title : $$LocaleString:"Graph Values" List Name : "Opening Balance", "Closing Balance" Format : $Name, 20 ;; Ledger collection to get ledger name opening balance and closing balance in graph [Collection: TSPL Funds collection] Type : Ledger Fetch : Name, Closingbalance, OpeningBalance Max : 10 Filter : TSPLFundsFilter Switch : ValueSort : TSPLGraphClosing : ##TSPLGraphValue = "Closing Balance" Switch : ValueSort : TSPLGraphOpening : ##TSPLGraphValue = "Opening Balance" [!Collection: TSPLGraphClosing] Sort : @@Default : $Closingbalance [!Collection: TSPLGraphOpening] Sort : @@Default : $OpeningBalance [System: Formula] ;;Used in Filter attribute of collection to get only bank and cash ledgers TSPLFundsFilter: $$IsLedOfGrp:$Name:$$GroupBank OR $$IsLedOfGrp:$Name:$$GroupBankOD OR $$IsLedOfGrp:$Name:$$GroupCash ;;EOF