Anda di halaman 1dari 8

Tally Technology

The Complete Reference


Preface
This is an era of Domain Specific Languages(DSL’s). Well-designed DSL’s have been quite
valuable with programmers operating in a specific domain. These prove particularly worth-
while from the point of view of improvements in productivity and faster implementation
cycles.

The heart and crux of Tally Technology is the DSL-Tally Definition Language (TDL) which
has been there from the advent of Tally version 5.4 during the late 90’s i.e., around 1995-96.
The language used in development of Tally, predominantly made its presence felt with
business programmers who opted for developing customizations and extensions on Tally.
Over the years, major advancements in Tally Technology resulted in transformation of Tally as
a complete Application Development Platform. The developments in TDL resulted in capabil-
ities for rapid development, rendering, data management and integration. The Tally Definition
Language (TDL) along with the development suite Tally.Developer 9(TD 9) provides the
strong technology backbone for developing solutions on Tally platform.

This book provides a comprehensive coverage of Tally technology starting from the basic
understanding of Tally architechture to in-depth concepts, usage and implementation scenarios
using TDL. With each chapter you will find explanations for topics along with syntax and
examples substantiating the content. The exercises provided give a good hands-on experience
for the concepts learnt.

The preliminary chapters from 1 through 5 mainly focus on the various components of the
language along with user interface design elements. The chapters 6 through 11 provide the
core capability coverage on the basis of which Tally is termed as an “Application Develop-
ment Platform”. The chapters “6. Objects, Collections and Internal Object Structure”,
“8. Object Manipulation and Storage in TDL” and “11. User Defined Fields, Validation and
Controls” emphasize solely on data storage, manipulation and retrieval methodologies using
the user interface. The chapters “7. Actions, Event Framework and Key Definition” and “9.
TDL Procedural Capabilities“ cover concepts which make TDL a true action and event driven
language with procedural capabilities augmenting its power. The chapter “10. Variable Frame-
work” helps in understanding the usage of various types of variables available in TDL. The
chapter “12. Advanced Reporting and Printing” will take you through the various reporting
and printing techniques. The various techniques aid in development of simple tabular reports
to complex columnar reports which provide a strong foundation in the area of MIS reporting.

Towards the end you will find various use cases which will give you an insight on various
implementation scenarios emphasizing on the application of concepts covered. By the time
you complete the book you are ready to undertake the project work “Inventory Management-
Garment Store” and dive into the over expansive world of Tally Technology.
Table of Contents
Chapter 1: Tally Technology – An Overall Perspective
1.1 Introduction ............................................................................................................................... 1
1.2 Need for Tally Extensions ............................................................................................ 2
1.3 The Domain Specific Language – TDL........................................................................ 4
1.3.1 Definition Language .......................................................................................................... 4
1.3.2 Action Driven Language with Procedural Capabilities .................................................... 4
1.3.3 Completely Object Oriented .............................................................................................. 4
1.4 Tally – As a Development Platform ..................................................................................... 5
1.4.1 Rapid Development ............................................................................................................ 5
1.4.2 Flexibility ........................................................................................................................... 6
1.5 Components of a TDL program .......................................................................................... 6
1.5.1 Underlying Tally Technology ............................................................................................ 8
1.6 Tally Architecture – Overview ............................................................................................. 9
1.6.1 The Application/Tally.ERP 9 Layer ................................................................................. 10
1.6.2 The TDL Language and Interpreter Layer ...................................................................... 10
1.6.3 Platform Layer/Engine ..................................................................................................... 10
1.7 Tally Technology – Capabilities .......................................................................................... 12
1.7.1 Solution-ability & Customizability .................................................................................. 12
1.7.2 Multiple Output Capability .............................................................................................. 12
1.7.3 Data Management Capability .......................................................................................... 12
1.7.4 Integrate-ability ............................................................................................................... 13
1.8 Tally Development Environment ........................................................................................ 13
1.8.1 Getting Started with TD 9 ................................................................................................ 15
1.8.2 Usage of Different Explorer Windows ............................................................................. 16
1.8.3 Usage of different Browsers and Property Window ........................................................ 16
1.8.4 Coding Convention .......................................................................................................... 17
1.8.5 Navigating and understanding the Tally Source Code(Default TDL project) ................. 18
1.8.6 Folder Structure and File naming convention ................................................................. 18
1.8.7 Navigating and Searching project Default TDL .............................................................. 18
1.9 TDL Program Life Cycle ...................................................................................................... 18

Chapter 2: Definitions, Attributes and Modifiers


2.1 Introduction ............................................................................................................................. 23
2.2 Definitions ............................................................................................................................... 23
2.2.1 Definition Categorization ................................................................................................ 24
2.3 Attributes ................................................................................................................................. 32
2.3.1 List Type Attribute ............................................................................................................ 33
2.3.2 Attribute Feature – Discreteness ..................................................................................... 34
2.3.3 Classification of Attributes .............................................................................................. 35
2.3.4 Predefined Attribute Values in TDL ................................................................................ 39
2.4 Aliases for Definitions and Attributes ................................................................................ 39
2.5 Definition – Default ............................................................................................................... 40

i
Table of Contents

2.6 Modifiers ................................................................................................................................. 42


2.6.1 Definition Modifiers ......................................................................................................... 42
2.6.2 Attribute Modifiers ........................................................................................................... 43

Chapter 3: Datatypes, Operators and Expressions


3.1 Introduction ............................................................................................................................. 55
3.2 Data Types .............................................................................................................................. 55
3.2.1 Simple Data Types ........................................................................................................... 56
3.2.2 Compound Data Type ...................................................................................................... 57
3.2.3 Data Type Formats .......................................................................................................... 60
3.2.4 Data Conversion (Type Casting) ..................................................................................... 64
3.3 Operators in TDL ................................................................................................................... 70
3.3.1 Unary Operators .............................................................................................................. 70
3.3.2 Arithmetic Operators ....................................................................................................... 71
3.3.3 Logical Operators ............................................................................................................ 72
3.3.4 Comparison Operators .................................................................................................... 75
3.3.5 String Operators .............................................................................................................. 77
3.3.6 Operator Precedence ....................................................................................................... 78
3.3.7 Data Types supported by Arithmetic Operators .............................................................. 79
3.4 Expressions in TDL ............................................................................................................... 83

Chapter 4: Access Specifiers and Special Symbols


4.1 Introduction ............................................................................................................................. 85
4.2 Access Specifiers ................................................................................................................... 86
4.2.1 Usage of @ and @@ ....................................................................................................... 86
4.2.2 Naming Conventions for Formulae ................................................................................. 86
4.2.3 Classification of Formulae .............................................................................................. 86
4.2.4 Accessing a Local Formula using @ ............................................................................... 87
4.2.5 Accessing of Global Formula using @@ ........................................................................ 87
4.2.6 The Usage of # ................................................................................................................. 88
4.2.7 The Usage of ## ............................................................................................................... 88
4.2.8 Usage of $ and $$ ............................................................................................................ 92
4.3 Overview of a Method .......................................................................................................... 92
4.3.1 Accessing Method value using $ ...................................................................................... 93
4.4 Functions in TDL ................................................................................................................... 93
4.4.1 Accessing a Function using $$ ....................................................................................... 93
4.5 Frequently used functions in TDL .................................................................................... 101
4.5.1 Type Casting Functions ................................................................................................. 101
4.5.2 Mathematical Functions ................................................................................................ 103
4.5.3 Logical Functions .......................................................................................................... 104
4.5.4 Date Functions ............................................................................................................... 106
4.6 Special Symbols ................................................................................................................... 110
4.6.1 Usage as Definition Modifiers ....................................................................................... 110
4.6.2 Usage as Code Differentiators ...................................................................................... 112
4.6.3 Usage in ODBC Context ................................................................................................ 114

ii
Table of Contents

4.7 Valid Expressions in TDL .................................................................................................. 115

Chapter 5: Dimensions, Formatting and Report Layouts


5.1 Introduction ........................................................................................................................... 119
5.2 Units of Measurement ......................................................................................................... 119
5.3 Dimensional Attributes ....................................................................................................... 120
5.3.1 Sizing/ Size Attributes .................................................................................................... 120
5.3.2 Spacing/ Position Attributes .......................................................................................... 127
5.3.3 Alignment Attributes ...................................................................................................... 132
5.3.4 Some Specific Attributes ................................................................................................ 146
5.4 Definitions and Attributes for Formatting ....................................................................... 150
5.4.1 Border ............................................................................................................................ 150
5.4.2 Style ................................................................................................................................ 152
5.4.3 Color .............................................................................................................................. 154
5.5 Color, Background, PrintFG and PrintBG Attribute ...................................................... 157
5.6 Format Attribute ................................................................................................................... 159
5.7 Report Layouts in Tally.ERP 9 .......................................................................................... 160
5.7.1 Tabular Report – Eg: Ledger Vouchers ......................................................................... 160
5.7.2 Columnar Report – Eg: Sales Register ......................................................................... 161
5.7.3 Designing a Hierarchical Report – Eg: Trial Balance .................................................. 162

Chapter 6: Objects, Collections and Internal Object Structure


6.1 Introduction ........................................................................................................................... 165
6.2 Objects – In General ............................................................................................................ 165
6.2.1 Tally Object Structure .................................................................................................... 166
6.2.2 Object Types ................................................................................................................... 168
6.3 Collections ............................................................................................................................. 170
6.3.1 Simple and Compound Collection ................................................................................. 171
6.3.2 Populating a Collection ................................................................................................. 171
6.3.3 Dynamic Objects ............................................................................................................ 181
6.4 Methods ................................................................................................................................. 186
6.4.1 Internal Methods ............................................................................................................ 186
6.4.2 User Defined / External Methods .................................................................................. 187
6.4.3 Object Association ......................................................................................................... 187
6.5 Object Context ...................................................................................................................... 198
6.5.1 Accessing Methods ......................................................................................................... 199
6.5.2 Data Object Context Switching ...................................................................................... 208
6.5.3 Interface Object Context Switching ............................................................................... 219
6.6 Collection Capabilities ........................................................................................................ 224
6.6.1 Basic Capabilities .......................................................................................................... 225
6.6.2 Grouping & Aggregation ............................................................................................... 236
6.6.3 Usage as Tables ............................................................................................................. 255
6.6.4 Collection Functions – Data Retrieval & Filtering ....................................................... 262
6.7 Voucher Object Structure ................................................................................................... 268

iii
Table of Contents

Chapter 7: Action, Event Framework and Key Definition


7.1 Introduction ........................................................................................................................... 273
7.2 Action Framework ............................................................................................................... 273
7.2.1 Understanding Actions .................................................................................................. 273
7.2.2 Action Association ......................................................................................................... 282
7.2.3 Classification of Predefined Actions ............................................................................. 292
7.2.4 Action Execution & Evaluation Process ........................................................................ 293
7.2.5 Scope of Actions ............................................................................................................. 295
7.2.6 Dynamic Actions ............................................................................................................ 299
7.2.7 Frequently used System and Object Specific Actions .................................................... 302
7.3 Key Definition ...................................................................................................................... 316
7.3.1 Attributes of the Definition Button / Key ....................................................................... 318
7.4 Event Frame Work ............................................................................................................... 323
7.4.1 Understanding TDL Events ........................................................................................... 324
7.4.2 Different Types of Events In TDL .................................................................................. 324

Chapter 8: Object Manipulation and Storage in TDL


8.1 Introduction ........................................................................................................................... 333
8.2 Object Manipulation using the Tally Interface(Field, Report & Menu) ..................... 334
8.2.1 Field Attribute – Storage ............................................................................................... 334
8.2.2 Data Object Association – Report level ......................................................................... 335
8.2.3 Actions for Object Manipulation(Creation and Alteration) .......................................... 335
8.3 Object Manipulation using TDL/User Defined Functions (Procedural Capabilities) 352
8.4 Object Manipulation using Data gathered from External Data Sources .................... 353

Chapter 9: TDL Procedural Capabilities


9.1 Introduction ........................................................................................................................... 355
9.2 Functions – In TDL ............................................................................................................. 355
9.2.1 In Built/Platform Defined Functions ............................................................................. 356
9.2.2 User Defined TDL Procedures/Functions ..................................................................... 356
9.3 Function – Building Blocks ............................................................................................... 360
9.3.1 Definition Block ............................................................................................................. 361
9.3.2 Procedural Block ........................................................................................................... 365
9.4 Function Execution – Object Context .............................................................................. 365
9.4.1 Target Object Context .................................................................................................... 365
9.4.2 Parameter Evaluation Context ...................................................................................... 366
9.4.3 Return Value Evaluation ................................................................................................ 366
9.5 Valid Statements – Inside Functions ................................................................................ 367
9.5.1 Programming Constructs ............................................................................................... 367
9.5.2 Actions ........................................................................................................................... 385
9.6 File Input/Output Capability .............................................................................................. 402
9.6.1 Source File Context ....................................................................................................... 403
9.6.2 Target File Context ........................................................................................................ 403

iv
Table of Contents

9.6.3 File Operations .............................................................................................................. 403


9.6.4 Generic File Operations ................................................................................................ 404
9.6.5 Generic Functions .......................................................................................................... 406
9.6.6 Read/Write Operation on Text Files .............................................................................. 408
9.6.7 Read/Write Operation on Excel Files ............................................................................ 412

Chapter 10: Variable Framework


10.1 Introduction ........................................................................................................................... 423
10.2 The Concept .......................................................................................................................... 423
10.2.1 Types of Variable ......................................................................................................... 423
10.3 The Usage .............................................................................................................................. 424
10.3.1 Variable Definition and Attributes ............................................................................... 424
10.3.2 Variable Declaration and Scope .................................................................................. 432
10.3.3 Using Modifiers with Variables ................................................................................... 442
10.3.4 List Variable Manipulations ........................................................................................ 443
10.3.5 Field Acting as a Variable ........................................................................................... 475
10.3.6 Implication of Repeat Variables in Columnar Report ................................................. 476
10.3.7 Common Functions used with Columnar Reports ....................................................... 478
10.3.8 Variables usage and behaviour in Auto Report ........................................................... 481
10.3.9 Repeat Line with Optional Collection .......................................................................... 483
10.3.10 Variables in Collection .............................................................................................. 491
10.3.11 Collection from a Variable ........................................................................................ 491
10.3.12 Variables in Remoting ................................................................................................ 492

Chapter 11: User Defined Fields, Validation and Controls


11.1 Introduction ........................................................................................................................... 495
11.2 User Defined Fields ............................................................................................................. 495
11.2.1
UDF Definition ............................................................................................................ 496
11.2.2
Storing Values into a UDF .......................................................................................... 497
11.2.3
Retrieving values from a UDF ..................................................................................... 497
11.2.4
UDF Types ................................................................................................................... 498
11.3 Validation and Controls ...................................................................................................... 512
11.3.1 Field Level Attributes ................................................................................................... 512
11.3.2 Form Level Attributes .................................................................................................. 515
11.3.3 Menu Level Attribute .................................................................................................... 516
11.3.4 Report Level Attribute .................................................................................................. 517

Chapter 12: Advanced Reporting and Printing


12.1 Introduction ........................................................................................................................... 523
12.2 Advanced Reporting ............................................................................................................ 523
12.2.1 Tabular Reports ........................................................................................................... 523
12.2.2 Columnar Reports ........................................................................................................ 541
12.3 Printing ................................................................................................................................... 575
12.3.1 Modes of Printing / Printing Formats ......................................................................... 576
12.3.2 Report Printing / Printing Techniques ......................................................................... 577

v
Table of Contents

12.3.3 Page breaks ................................................................................................................. 587


12.3.4 Multi Page/Part Printing ............................................................................................. 600
12.3.5 Printing on a Pre Printed Stationary ........................................................................... 604
12.3.6 Printing related Events – Before Print/After Print ...................................................... 605
12.3.7 Image Printing ............................................................................................................. 605
12.3.8 Additional Attributes and Functions ............................................................................ 609

Project Work: Inventory Management – Garment Store


1 F11 Features ............................................................................................................................... 619
2 Stock Item Master Creation ..................................................................................................... 621
3 Voucher Type Master Alteration ............................................................................................. 625
3.1 Purchase Voucher Type Creation ..................................................................................... 625
3.2 Sales Voucher Type Creation ........................................................................................... 626
3.3 Implementation Logic ....................................................................................................... 626
4 Voucher Entry ............................................................................................................................ 627
4.1 Garment Purchase Voucher ............................................................................................. 627
4.2 Implementation Logic ....................................................................................................... 628
4.3 Garment Sales Voucher .................................................................................................... 629
4.4 Implementation Logic ....................................................................................................... 629
5 Invoice ......................................................................................................................................... 630
5.1 Implementation Logic ....................................................................................................... 631
6 Garment Store Reports .................................................................................................. 631
6.1 Stock Summary with Brand/Type/Colour/Size (Existing Report - Stock Summary) ......... 631
6.2 Instructions for Filtering .................................................................................................. 631
6.3 Implementation Logic ....................................................................................................... 631
6.4 Instructions for Filtering .................................................................................................. 632
6.5 Implementation Logic ....................................................................................................... 632
7 Columnar Reports ....................................................................................................................... 633
7.1 Brandwise Itemwise Sizewise Sales (New Report) ........................................................... 633
7.2 Implementation Logic ....................................................................................................... 633
8 Color Scheme ............................................................................................................................. 634

Use Cases
1 Use Case I – Import from Excel/Text .................................................................................... 637
2 Use Case II – Multiple Saved Configurations for Report .................................................. 646
3 Use Case III – Multiple Email Configurations ..................................................................... 654
4 Use Case IV – Duplicating Vouchers .................................................................................... 660
5 Use Case V – Inter Company Data transfer .......................................................................... 664
6 Use Case VI – Multi Company Outstanding Report ........................................................... 669
7 Use Case VII – Voucher and Invoice Customization .......................................................... 673

vi

Anda mungkin juga menyukai