Understanding Integration Reports
Understanding Integration Reports
Understanding Integration Reports
Understanding Integration –
Reports
This section is intended to illustrate the approaches to get the data and reports from Tally through
XML request/ response.
Tally Data/Objects
Tally database is a true OODBMS(Object Oriented Database Management System). It is possible to
store data as objects and retrieve data as objects. In other traditional OODBMS, data pertaining to
an object is internally converted into disparate files and stored, but in Tally database data for an
object is stored as it is as a block. This allows faster retrieval of data.
Tally File System consists of data files (master, transaction, link masters), Msgfiles (transaction
management) and State Files (concurrency control and exclusivity control). It follows the concept
of embedded and weighted Indexes. In other traditional databases, separate index file is
maintained. In Tally, indexes are built into the data files. This facilitates faster retrieval of data.
By design, Tally database is hierarchical in nature i.e., objects are stored in a tree like structure.
Each node in the tree can be a tree in itself. In this structure, a parent can have multiple children
however every child can have only one parent. A child can further have multiple children. All the
characteristics of a child are inherited from its parent and no child can exist without a parent.
Reports
Tally creates the books of accounts and the financial statements based on the vouchers entered for
the particular period. The information is designed to allow a user to get the maximum benefit of the
data that is entered. A user gets a holistic picture of the data and he able to present information
using different options. The purpose of compiling data is to present it in comprehensible
accounting reports. On entering the vouchers, TallyPrime uses the same data and provides you with
the management control intelligences in addition to all books and statements.
The reports of Tally can be gathered through XML request/response. Tags used for sending a
request to export data from TallyPrime as follows.
Tag <DESC> can contain report configurations like Company Name, Format of export, etc. as
desired and which should be enclosed within <STATICVARIABLES> tag list.
If the Report Name specified in the <ID> tag does not exist within Tally running at the
specified port, the TDL defining the Report & other supporting definition needs to be
described and enclosed within tag <TDL>.
Object To get one particular object. For example, Ledger, Stock Item
Data To get the reports. For example, Balance Sheet, Trial Balance
The below mentioned XML request gets the Name and Parent of a single ledger from Tally
<ENVELOPE>
<HEADER>
<VERSION>1</VERSION>
<TALLYREQUEST>EXPORT</TALLYREQUEST>
<TYPE>OBJECT</TYPE>
<SUBTYPE>Ledger</SUBTYPE>
<ID TYPE=”Name”>NameofTheLedger</ID>
</HEADER>
<BODY>
<DESC>
<STATICVARIABLES>
<SVEXPORTFORMAT>$$SysName:XML</SVEXPORTFORMAT>
</STATICVARIABLES>
<FETCHLIST>
<FETCH>Name</FETCH>
<FETCH>Parent</FETCH>
</FETCHLIST>
</DESC>
</BODY>
</ENVELOPE>
The below mentioned XML request gets the data of all stock items from Tally
<ENVELOPE>
<HEADER>
<VERSION>1</VERSION>
<TALLYREQUEST>Export</TALLYREQUEST>
<TYPE>Data</TYPE>
<ID>List of Accounts</ID>
</HEADER>
<BODY>
<DESC>
<STATICVARIABLES>
</STATICVARIABLES>
</DESC>
</BODY>
</ENVELOPE>
The below mentioned XML request gets the data of ledgers of a particular group ‘Bank accounts’
The default report ‘List of Accounts’ in Tally provides all the masters created in a
company. Hence, an XML request can be sent to Tally to get details for the required
masters like Ledgers, Groups, Stock Items, Stock Groups, etc.
The below mentioned XML request gets the data of ledgers of a particular group ‘Bank accounts’
<ENVELOPE>
<HEADER>
<VERSION>1</VERSION>
<TALLYREQUEST>EXPORT</TALLYREQUEST>
<TYPE>COLLECTION</TYPE>
<ID>List of Ledgers</ID>
</HEADER>
<BODY>
<DESC>
<STATICVARIABLES>
<SVEXPORTFORMAT>$$SysName:XML</SVEXPORTFORMAT>
</STATICVARIABLES>
<TDL>
<TDLMESSAGE>
<NATIVEMETHOD>Name</NATIVEMETHOD>
<NATIVEMETHOD>Parent</NATIVEMETHOD>
</COLLECTION>
</TDLMESSAGE>
</TDL>
</DESC>
</BODY>
</ENVELOPE>
The default collection ‘List of Ledgers’ is available in Tally and it is altered in the above
request to pull only the ledgers created under the group ‘Bank Accounts’
Similar to masters, the data of transactions can be gathered from Tally through XML request. The
below mentioned XML request gets data of transactions for a specific period.
<ENVELOPE>
<HEADER>
<VERSION>1</VERSION>
<TALLYREQUEST>Export</TALLYREQUEST>
<TYPE>Data</TYPE>
<ID>DayBook</ID>
</HEADER>
<BODY>
<DESC>
<STATICVARIABLES>
<SVEXPORTFORMAT>$$SysName:XML</SVEXPORTFORMAT>
</STATICVARIABLES>
</DESC>
</BODY>
</ENVELOPE>
The below XML request gets data of transactions for a specific period and for specific voucher type
<ENVELOPE>
<HEADER>
<VERSION>1</VERSION>
<TALLYREQUEST>Export</TALLYREQUEST>
<TYPE>Data</TYPE>
<ID>Daybook</ID>
</HEADER>
<BODY>
<DESC>
<STATICVARIABLES>
<SVEXPORTFORMAT>$$SysName:XML</SVEXPORTFORMAT>
</STATICVARIABLES>
<TDL>
<TDLMESSAGE>
</TDLMESSAGE>
</TDL>
</DESC>
</BODY>
</ENVELOPE>
The default report ‘Day book’ in Tally provides all the transactions entered in a
company. Hence, an XML request can be sent to Tally to get the details of the required
vouchers. In the above example, the vouchers are filtered for a specific voucher type by
specifying a formula using TDL.
Gathering Reports
The reports available in Tally can be gathered through XML request/response. The below mentioned
XML request gets the existing report ‘Trial Balance’ from Tally.
<ENVELOPE>
<HEADER>
<VERSION>1</VERSION>
<TALLYREQUEST>Export</TALLYREQUEST>
<TYPE>Data</TYPE>
<ID>Trial Balance</ID>
</HEADER>
<BODY>
<DESC>
<STATICVARIABLES>
<SVEXPORTFORMAT>$$SysName:XML</SVEXPORTFORMAT>
</STATICVARIABLES>
</DESC>
</BODY>
</ENVELOPE>
<DSPACCNAME>
<DSPDISPNAME>Current Liabilities</DSPDISPNAME>
</DSPACCNAME>
<DSPACCINFO>
<DSPCLDRAMT>
<DSPCLDRAMTA>
</DSPCLDRAMTA>
</DSPCLDRAMT>
<DSPCLCRAMT>
<DSPCLCRAMTA>1526292.00</DSPCLCRAMTA>
</DSPCLCRAMT>
</DSPACCINFO>
<DSPACCNAME>
<DSPDISPNAME>Current Assets</DSPDISPNAME>
</DSPACCNAME>
<DSPACCINFO>
<DSPCLDRAMT>
<DSPCLDRAMTA>-43092.00</DSPCLDRAMTA>
</DSPCLDRAMT>
<DSPCLCRAMT>
<DSPCLCRAMTA></DSPCLCRAMTA>
</DSPCLCRAMT>
</DSPACCINFO>
<DSPACCNAME>
<DSPDISPNAME>Sales Accounts</DSPDISPNAME>
</DSPACCNAME>
<DSPACCINFO>
<DSPCLDRAMT>
<DSPCLDRAMTA></DSPCLDRAMTA>
</DSPCLDRAMT>
<DSPCLCRAMT>
<DSPCLCRAMTA>36000.00</DSPCLCRAMTA>
</DSPCLCRAMT>
</DSPACCINFO>
<DSPACCNAME>
<DSPDISPNAME>Purchase Accounts</DSPDISPNAME>
</DSPACCNAME>
<DSPACCINFO>
<DSPCLDRAMT>
<DSPCLDRAMTA>-1521000.00</DSPCLDRAMTA>
</DSPCLDRAMT>
<DSPCLCRAMT>
<DSPCLCRAMTA></DSPCLCRAMTA>
</DSPCLCRAMT>
</DSPACCINFO>
<DSPACCNAME>
<DSPDISPNAME>Indirect Expenses</DSPDISPNAME>
</DSPACCNAME>
<DSPACCINFO>
<DSPCLDRAMT>
<DSPCLDRAMTA></DSPCLDRAMTA>
</DSPCLDRAMT>
<DSPCLCRAMT>
<DSPCLCRAMTA>1800.00</DSPCLCRAMTA>
</DSPCLCRAMT>
</DSPACCINFO>
</ENVELOPE>
The value of the Tag <TALLYREQUEST> is Export, which indicates that some information
needs to be exported from Tally.
The value of the Tag <TYPE> is Data, which indicates that the data needs to be exported from
Tally. The value of the Tag <ID> must be a TDL Report Name, if the previous Tag <TYPE>
contains Data and Tag <TALLYREQUEST> contains Export. Any Report, which needs to be
exported from Tally, needs to be specified within these Tags.
<BODY> Tag contains parameters, if any. Additional settings for the report like format
required, company from which data is required, etc. can be passed within
<STATICVARIABLES> Tag enclosed within <DESC> Tag. All variables are considered as Tag
Names and their value are enclosed within these tags.
For example, in the above sample XML, Variable SVEXPORTFORMAT is considered as Tag and its
value $$SysName:XML is enclosed within. TDL Internal Function SysName is evaluated at Tally end
and the response is being sent accordingly.
Example:
<STATICVARIABLES>
<SVEXPORTFORMAT>$$SysName:XML</SVEXPORTFORMAT>
<SVFROMDATE TYPE=”Date”>1-Apr-2016</SVFROMDATE>
<SVTODATE TYPE=”Date”>1-Apr-2016</SVTODATE>
</STATICVARIABLES>
Tag <TDL>
The tag <TDL> is used to specify the TDL related information. This particular Tag is specified only
when the TDL Code required to serve the request and which is not present in default code of
TallyPrime. The complete TDL to be executed in order to handle the Request; The TDL will be sent
within the TDL block. Tally application will respond depending on the TDL request.
Example: A Request for a report ‘Simple Trial Balance’ has to be made. But, ‘Simple Trial balance’ is
not present in default code, thus, the definition of the same is specified in the TDL tag.
The TDL program is sent using TDL tag as per the following structure:
<TDL>
<TDLMESSAGE>
</TDLMESSAGE>
</TDL>
The <TDLMESSAGE> tag is mandatory inside the <TDL> tag. Inside that, we can write all the
definitions and its attributes with their values. All TDL definitions and attributes are represented as
tags.
Report, Collection, Function and Object can be specified inside the <TDL> tag. Consider the
following examples, which demonstrate the usage of <HEADER> values:
<VERSION>1</VERSION>
<TALLYREQUEST>Export</TALLYREQUEST>
<TYPE>Data</TYPE>
</HEADER>
In the above header format, the value of TallyRequest is Export and the Type is ‘Data’. Therefore, the
value of ID must be a name of a Report. This report name should be specified inside the tag
<REPORT> within the <TDL> tag.
Example:
<TDL>
<TDLMESSAGE>
</REPORT>
.
.
</TDLMESSAGE>
</TDL>
Let’s illustrate this case by sending a request to fetch data from the report ‘Simple Trial Balance’
that doesn’t exist at Tally end.
The XML Request with the TDL code for the customized report ‘Simple Trial Balance’
<ENVELOPE><HEADER>
<VERSION>1</VERSION>
<TALLYREQUEST>Export</TALLYREQUEST>
<TYPE>Data</TYPE>
</HEADER>
<BODY>
<DESC>
<STATICVARIABLES>
<EXPLODEFLAG>Yes</EXPLODEFLAG>
<SVEXPORTFORMAT>$$SysName:XML</SVEXPORTFORMAT>
</STATICVARIABLES>
<TDL>
<TDLMESSAGE>
<TITLE>”Trial Balance”</TITLE>
</REPORT>
<TOPPARTS>Simple TB Part</TOPPARTS>
<HEIGHT>100% Page</HEIGHT>
<WIDTH>100% Page</WIDTH>
</FORM>
<TOPLINES>
</TOPLINES>
<SCROLLED>Vertical</SCROLLED>
<COMMONBORDERS>Yes</COMMONBORDERS>
</PART>
<USE>Simple TB Details</USE>
<BORDER>Flush Totals</BORDER>
</LINE>
<LEFTFIELDS>Account Name</LEFTFIELDS>
<RIGHTFIELDS>Account Value</RIGHTFIELDS>
</LINE>
<USE>Account Name</USE>
<SET>$Name</SET>
</FIELD>
<USE>Account Value</USE>
<SET>$ClosingBalance</SET>
<BORDER>Thin Left</BORDER>
</FIELD>
<TYPE>Ledger</TYPE> <FILTERS>NoProfitsimple</FILTERS>
</COLLECTION>
NOT $$IsLedgerProfit
</SYSTEM>
</TDLMESSAGE>
</TDL>
</DESC>
</BODY>
</ENVELOPE>
The above XML Request is similar to the previous request given for getting the report Trial Balance.
The difference here is the Report Name contained within the Tag “<ID>” is not specified in Tally.
Therefore, In the Tag <BODY> within Tag <DESC>, an additional tag <TDL> must be specified with
the TDL describing the Report and its components enclosed within Tag <TDLMESSAGE>.’
<ENVELOPE>
<ACCTSINFO>
<ACCOUNTVALUE>1,29,377.00</ACCOUNTVALUE>
</ACCTSINFO>
<ACCOUNTNAME>Sales</ACCOUNTNAME>
<ACCOUNTVALUE>1,29,277.00</ACCOUNTVALUE>
</ACCTSINFO>
</ENVELOPE>
The feature ‘Convert to XML TDL’ in TallyPrime Developer allows you to convert
projects/files that are in TDL to XML TDL. This simplifies the generation of XML
request.
<ENVELOPE>
<HEADER>
<VERSION>1</VERSION>
<TALLYREQUEST>Export</TALLYREQUEST>
<TYPE>Data</TYPE>
<ID>Trial Balance</ID>
</HEADER>
<BODY>
<DESC>
<STATICVARIABLES>
<SVEXPORTFORMAT>$$SysName:HTML</SVEXPORTFORMAT>
</STATICVARIABLES>
</DESC>
</BODY>
</ENVELOPE>
The HTML content of the response has to be saved in an html file (*.html) to view the
content as shown above.
Guidelines
Names of some most frequently used reports in Tally
Accounting Reports
Details of vouchers
Day Book
for a specified period
Opening / transacted
/ Closing Balances
Trial Balance
of all accounting
groups and ledgers
Outstanding report
Bills Receivable
for Receivables
Inventory Reports
Common Variables used in Tally Reports
Note: All the other variables used across the reports in Tally can be referred in default
TDL which is available in TallyPrime Developer.
Step-1: Click on menu ‘Navigate’ and select the option ‘Jump to Definition’
Step-2: Select Report from this definition list shown in field Definition type
Step-3: Type Profit and Loss and select the report from the list of reports shown in field Definition
Name
The cursor will be jumped to the selected definition as per the example given below.
Related Topics
Understanding Accounting Masters Integration