A blog on customizing Tally Accounting Software by Shweta Softwares
Wednesday, February 28, 2007
Example 18: Trial Balance - A Top-to-Bottom view
Click here to download the Example 18 compiled file and the source-code.
Monday, February 26, 2007
Example 17: Using Ledger Object to display Ledger help-list
;; Modify the "Gateway of Tally" menu and Add a new option "Ledger Help" |
Click here to download the Example 17 compiled file and the source-code.
Corrections
2) Group Master (GROUP.ZIP) and Ledger Master (LEDGER.ZIP) files are now available for download from FTP site. Due to the large file-size (appx 2MB each), there was problem sending these files by email to certain email accounts. There shouldn't be any problems now as you can get it via FTP directly.
Saturday, February 24, 2007
Example 16: Fetch Address of Sundry Debtors/Creditors
Click here to download the Example 16 compiled file and the source-code.
Friday, February 23, 2007
Example 15: Add Salesman field in "Sales Voucher" entry screen
Add a Salesman field in the default Voucher Entry screen. This field should appear
only when the Voucher type is Sales
|
Click here to download the Example 15 compiled file and the source-code.
Thursday, February 22, 2007
Example 14: Colorful Trial Balance
This example is an extension to Example 12a. It display Ledgers in RED color if the Ledger balance is greater than 1000.
Click here to download the Example 14 compiled file and the source-code.
Tuesday, February 20, 2007
Example 12a: Attributes ChildOf; BelongsTo; Filter
The ChildOf attribute is used with Collections. It controls how the Collection is displayed. Example:-
[Collection: My Collection] |
The above TDL code returns all the Ledgers directly falling under Group "Sundry Debtors".
BelongsTo attribute
The BelongsTo attribute returns all the objects directly or indirectly falling under the specified Collection. Example:-
[Collection: My Collection] |
The above TDL code returns all the Ledgers falling under Group "Sundry Debtors" and its sub-groups.
Filter attribute
The Filter attribute is used to set a filter on the Collection. Example:-
[Collection: My Collection] |
The above TDL code returns all the Ledgers falling under Group "Sundry Debtors" and its sub-groups where the ClosingBalance is greater than Zero.
A TDL program illustrating the above attributes is given herewith for your reference. Click here to download the Example 12a compiled file and the source-code.
Monday, February 19, 2007
Example 12: More on Collections
Click here to download the Example 12 compiled file and the source-code.
Saturday, February 17, 2007
Example 11: Objects & Collections
Objects in TDL are classified as Internal Objects and External Objects.
Internal Objects
There are several pre-defined Internal Objects in TDL viz. Company, Group, Ledger, Stock Group, Stock Item, Voucher, Voucher Type etc.
External Objects or User-defined Objects
You can define your own Objects in TDL. Example:-
[Object: Contact1] |
We shall be using Internal and External Objects quite frequently in the succeeding sections of this tutorial.
Collections
A Group of Objects is referred as a Collection. You can create a collection of the Objects as follows:-
[Collection: My Collection] |
A Program illustrating the use of Objects and Collection is provided for your reference. Click here to download the Example 11 compiled file and the source-code.
Retrieving Value of Internal Objects & Internal Functions
The symbol '$' is used to retrieve the value of Internal Objects. For example, '$' can be used to fetch the ClosingBalance or Name field-value of the Internal Object LEDGER.
[Field: My Field]
Set as: $Name
Symbol '$$'
The symbol '$$' is used to retrieve the Function Values in TDL. For example, '$$' can be used to fetch the Date as shown below.
[Field: My Date]
Set as: $$MachineDate
There are several Internal functions in TDL which shall be discussed in the forth coming sessions.
Local and Global Formulae
Local Formulae
[Field: My Field]
Set as: @Company
Company: "ABC PVT LTD"
In the above field definition, the "Set as" attribute is used to set the value of the field using a local formulae "Company" To access local formulae, "@" symbol is used.
Global Formulae
[System: Formula]
MyBackgroundColor: "Yellow"
[Field: MyField]
Set as: "www.tdlplayground.blogspot.com"
Background: @@MyBackgroundColor
When you require a formula in more than one fields, you need to create a Global formula. To access Global formula value, the symboll "@@" is used.
Thursday, February 15, 2007
Example 10: UDFs
You can add new fields in any Master entry screen or Voucher entry screen by creating UDFs (User-defined Fields). UDFs can be of type String, Number, Date, Logical, Amount, Quantity or Rate.Notes:-
Syntax:-
[System: UDF]
<UDF Name>: <UDF Type>: <Index>: <Is Repeatable>
Example:-
[System: UDF]
MyUDF: String: 1000
1) UDFs are to be defined at the System level.
2) Each UDF must be given a Unique Name.
3) As Index number is to be provided for evey UDF which must be between 1 to 9999.
4) Is Repeatable specifies whether the UDF holds single or multiple values. By default, it is NO, meaning the UDF can store a single value only.
Example:- Adding a new field in the Ledger Master
;;UDF definition |
Click here to download the Example 10 compiled file and the source-code.
Wednesday, February 14, 2007
Example 9: The power of Inheritance
|
You may define Objects that inherit from any other User-defined Object or even from the default TDL Objects. In simple words, you can define a report which inherits from the default TDL report "Balance Sheet" and then you may customize it as per your requirement.
Click here to download the Example 9 compiled file and the source-code.
Example 8: Display a small dialog-box and accept user-input
Click here to download the Example 8 compiled file and the source-code.
Tuesday, February 13, 2007
Example 7: Local and Global Variables
Local Variables
The scope of Local variables is restricted to the Report in which they are defined. Before you can use a local variable, you need to define it. To access the value of a local variable, you must prefix the variable name with symbol #
Local Variable definition
[Variable: myVar]
Type: String
Using the Local variable in your Report
[Report: My Report]
Form: MyForm
Variable: myVar
Set as: "Learn TDL at www.tdlplayground.blogspot.com"
Accessing the Local Variable value
[Field: My Field]
Set as: #myVar
Global Variables
Global variables can be used globally (i.e. in all Reports). A Global variable must be declared in the [System: Variable] section. To access a Global variable, you must prefix the variable name with ##.
Global Variable definition
[System: Variable]
myVar: "Initial Value"
Accessing the Global Variable value
[Field: My Field]
Set as: ##myVar
Other Variable types supported by Tally
1) Logical
2) Date
3) Number
4) Amount
5) Quantity
6) String
7) Rate of Exchange
A sample TDL program (with source-code) has been provided which illustrates the use of Variables. Click here to download the Example 7 compiled file and the source-code.
Saturday, February 10, 2007
TDL basics - An overview
TDL is not a full-fledged programming language, but it is a Definition's language. It has its own pros and cons. Using TDL, you can add new menu-options, new reports, new entry screens in Tally 7.2 or Tally 9. However, the programmer does not have any control over the event-driven functionality of Tally.
TDL Basics - An Overview
1. Names are neither case-sensitive nor space-sensitive.
[Report: MyReport] is the same as [Report: MYREPORT]
[Report: My Trial Balance] is the same as [Report: MyTrialBalance]
2. Names should not start with numerals.
3. Comments in TDL are written using double semi-colon (i.e. ;;)
4. A TDL program comprises of TDL statements / definitions and can be written using any text editor (example:- Notepad)
5. To compile TDL program, you require Tally Developer which can be purchased from Tally Solutions or any Tally authorised Dealer. [If you don't have Tally Developer, you may send your TDL programs to mailto:tdlplayground@rtslink.com.
6.All reports in Tally Accounting software have been created using TDL.
7.You can modify existing Menu's in Tally and add your own menu-options. Example:-
[#Menu: Gateway of Tally]
Add: Item: My Reports: Display: rptMyReport
The above code modifies the "Gateway of Tally" menu, and adds a new menu-option "My Reports". When the user clicks on "My Reports" menu-option, it display a report named "rptMyReport". The "#" symbol is used to modify existing definitions.
8.Normally, forms are used in programming languages like VB, VFP, Delphi etc to display text and accept user input. In TDL, you have to use the Report definition which uses the following:-
Report uses Form
Form uses Parts
Part uses lines
Line uses Fields
Field is the real-container where text is displayed.
Remarks:- ratta laga le bhai. Isme samajne jaissa kuch bhi nahi hai.
9.Actions are used to implement/activate the definitions. Example, Display action is used below.
[#Menu: Gatway of Tally]
Add: Item: My Reports: Display: rptMyReport
10. Attributes are like properties. Example, Width and Style
[Field: My Field]
Width: 30
Style: Normal Bold
11. Dimensions in TDL can be expressed in different ways
.
[Form: My Form]
;; This specifies the dimension of the form in centimeters
Width: 15 cms
Height: 25 cms
[Form: My Form]
;; This specifies the dimension of the form in Inches
Width: 2 Inches
Height: 2 Inches
[Form: My Form]
;; This specifies the dimension of the form in screen percentage
Width: 15% screen
Height: 25% screen
12. Some of the important attributes that we shall be using with different Definitions are:-
Width: 30% screen
Height: 30% screen
BackGround: Yellow
Invisible: No
Inactive: No
Set as: "Welcome to TDL"
Space Top: 2
Space bottom: 2
Space Left: 2
Space Right: 2
The above attributes are to be used with their appropriate Definitions only.
13. Button is an attribute of Menu and Form definition and is used to intiate actions.
[Button: My Button]
Title: "My Balance Sheet"
Key: F4
Action: Display: Balance sheet
[#Menu: Gateway of Tally]
Button: My Button
The above code is used to display button "My Balance Sheet" in the "Gateway of Tally" menu. It is invoked by pressing F4 function key.
14.Optional defintions
A TDL program mainly comprisely of definitions and actions. Actions are performed on Definitions to implement/activate them.
TDL allows you to use Optional definitions. In simple words, Optional definition is a definition that is activated/executed if specified condition evaluates to be true. Example:-
;;This is an a regular Form definition
[Form: My Form]
Width: 10% screen
Height: 10% screen
Option: TestForm1: #myVariable
;;This is an optional definition
[!Form TestForm1]
Width: 30% screen
Height: 30% screen
Notes:
a) If the value of variable "myVariable" evaluates to be true, then the optional definition "TestForm1" becomes part of the original definition "My Form".
b) In other words, the original definiton is over-ridden by the Optional definition .
FINAL WORDS
Please send in your views/comments to mailto:tdlplayground@rtslink.com. Please mention whether you found this article to be useful or not. Your valuable suggestions are solicited.
From
Shweta Computers Team
Wednesday, February 7, 2007
Example 6: Adding BUTTONs in TDL Form
|
Notes:
1) The form "frmForm" uses a button which is displayed in the Button panel on the right-side of the screen.
2) The Option Attribute provides a means to substitue the original definition with modified definition. In the above code, two optional definitions have been used. The syntax of Option keyword is :-
Syntax: Option : <Modified Definition>: <Logical condition>
Click here to download the Example 6 compiled file and the source-code.
Example 5: Using Font-styles, Colors in TDL
|
Click here to download the Example 5 compiled file and the source-code.
NEWFONTS .TCP
Functionality
NEWFONTS.TCP file changes the Invoice Fonts in the neat-mode printing.
Steps to use NEWFONTS.TCP
1) Include NEWFONTS.TCP in the Tally.ini file as described in the Introduction blog section.
2) Try-out printing any Sales Invoice.
Click here to download the Newfonts compiled file.
BUYCON.TCP
Functionality
BUYCON.TCP displays Ledger help-list in the "Supplementary Details" section of Sales Voucher (in EDIT mode).
Steps to use BUYCON.TCP
1) Include BUYCON.TCP in the Tally.ini file as described in the Introduction blog section.
2) Use option "Gateway of Tally -> F12 -> Invoice/Order Entry" and enable the "Accept Supplementary details" option.
3) Modify any existing Sales Voucher. Move on to the Buyer's details section (yellow-color window) and press spacebar in the BUYER field. This will bring forth the Ledger help-list.
Click here to download the Buycon compiled file.
Monday, February 5, 2007
Example 4: Display a Sub-Menu with Indentation
|
Notes:-
1) The above program displays a Sub-Menu with Indentation
Click here to download the Example 4 compiled file and the source-code.
Example 3: Display a Form
|
Notes:-
1) The above program defines a menu-option "MyOption" in the "GateWay of Tally" screen before Balance Sheet. Note the tidle character ~ in front of Balance Sheet which highlights the next letter after it.
2) When the user selects this option "MyOption", it displays a Form.
Click here to download the Example 3 compiled file and the source-code.
Sunday, February 4, 2007
Example 2: Add a Sub-Menu option
|
Notes:-
1) The above program defines a menu-option "MyOption" in the "GateWay of Tally" screen
2) When the user selects this option "MyOption", it displays a sub-menu with three options
Click here to download the Example 2 compiled file and the source-code.
Example 1: Add a Menu-option
[#Menu: Gateway of Tally] |
Notes:-
1) Comments in TDL are written using double semi-colon ;;
2) The above TDL code contains several definitions viz. Menu,Report, Form, Part, Line, Field
3) Definitions are always written in square brackets
4) The # symbol modifes the default TDL menu "Gateway of Tally"
Click here to download the Example 1 compiled file and the source-code.
Introduction to Tally Definition Language (TDL)
READ our sample programs to know more about progamming with Tally Definition Language. We shall be posting sample programs regularly on this blogspot. Initially, we shall start with some basic features of TDL and later-on move to more advanced topics.
You can create your own TDL programs using any text-editor (like NOTEPAD). To compile these program, you need Tally Developer 2.7 which can purchased from Tally Solutions or any other Tally Authorised Dealer or Service centre.
Please note that we don't sell Tally Developer 2.7.
When you compile your TDL program using Tally Developer, a TCP (Tally Compiled Program) file is generated. To use this TCP file, you need to do certain changes in the Tally.ini file. The Tally.ini file is located in the directory where Tally Software is installed.
Changes required in Tally.ini
USER TDL = YES
TDL = C:\TALLY\TDL1.TCP
Remarks:-
a) You are required to copy your TCP file to the Tally directory.
b) Use NOTEPAD to open and modify the Tally.ini file.
Create your own TDL programs
As mentioned earlier, TDL programs are simple text files that contain TDL statements. You can easily create TDL programs using Notepad. Next, you need to compile it. In case, if you don't have the Tally Developer software, you can send us your TDL file (i.e. simple text file with TDL statements) to us. We shall compile it and send it back to you. You can mail your TDL programs to TDLplayground@rtslink.com. However, we cannot give you 100% commitment that all such requests will be entertained because of the large number of emails that we receive.
If your program is worth its salt, we shall publish it in this blogspot (of-course with your prior-permission).
You can visit us at www.rtslink.com