A blog on Tally Integration, to import and export data from Tally.ERP programmatically using VB6, VB.NET,C#,ASP.NET etc

Friday, December 21, 2007

Ledger and StockItem Masters

How can I retrieve Ledger and StockItem Masters with their Closing balances ?

You can retrieve Ledger & StockItem masters with their Closing balances either using SQL-SELECT or XML Tags.

SQL-SELECT statement

Ledger-Master
SELECT $Name, $ClosingBalance FROM Ledger

StockItem Master
SELECT $Name, $ClosingBalance FROM StockItem

XML tags

Refer this link for more information XML tags to retrieve Tally Masters



Fetch Currency information from Tally Software

You can retrieve Currency details using SQL-SELECT or XML tags as given below:-

Using SQL-SELECT
SELECT $Name,$OriginalSymbol FROM currency

Using XML tags
<ENVELOPE>
<HEADER>
<TALLYREQUEST>Export Data</TALLYREQUEST>
</HEADER>
<BODY>
<EXPORTDATA>
<REQUESTDESC>
<REPORTNAME>List of Accounts</REPORTNAME>
<STATICVARIABLES>
<SVEXPORTFORMAT>$$SysName:XML</SVEXPORTFORMAT>
<ACCOUNTTYPE>Currencies</ACCOUNTTYPE>
</STATICVARIABLES>
</REQUESTDESC>
</EXPORTDATA>
</BODY>
</ENVELOPE>



Friday, November 9, 2007

Access Tally Data on a Remote Computer using RTSlink DLL

FAQs: Tally Integration using RTSlink DLL

Can I use RTSlink DLL to access Tally data from a Computer which is located in a different city or country ?

Yes. You can use RTSlink DLL to access (push or pull) Tally data from a Remote Computer which is located in a different city or country.

LIVE DEMO

Live demonstration to access (pull and push) Tally data along with support and guidance is provided to registered users of RTSlink DLL v1.9.

DEMO Situation 1
We shall provide support / guidance and demonstrate how you can access Tally data from our Computer which is located at Gandhidham, Gujarat, India.

DEMO Situation 2
We shall demonstrate and access Tally data from your Computer where-ever you are located.

Please see:-
- This is available to registered users of RTSlink DLL v1.9 only. (i.e. those who have purchased and registered RTSlink DLL v1.9)
- Registered users who are interested in Demo are requested to write to support@rtslink.com with their RTSlink DLL serial number and fix timings for Demonstration.
- Demo shall be provide once only.
- Users must have Internet connection, preferably broad-band.
- Transfer of data over Internet may be slow/time consuming.

Thursday, October 18, 2007

Corrections in ldaily.txt and ldaily.xml

Minor corrections have been done in the XML and TDL file to fetch "Ledger Daily balances" using RTSlink DLL.

FILE: ldaily.txt

Old Code
Set : LedgerName: "Cash"

New Code
Set : LedgerName: If $$IsEmpty:##LedgerName then "Cash" else ##LedgerName

Please see:
A syntax error in lDaily.xml has also been rectified.

Wednesday, October 17, 2007

Bug in $$ItemSerial TDL function

Tally Integration using RTSlink DLL

$$ItemSerial [TDL function]

"The function $ItemSerial generates Line numbers beginning from 0. It does not accept any parameter and returns Numerical value. "

Using $ItemSerial function with Masters

SELECT $$ItemSerial,$Name FROM Ledger

Remarks:-
The $$ItemSerial works fine when used with any MASTER's Collection like LEDGER, GROUP,STOCKITEM etc. However, it returns random (incorrect) values when used with VOUCHER object as shown below.

Using $$ItemSerial function with Vouchers

SELECT $$ItemSerial, $Date, $VoucherTypeName, FROM RTSAllVouchers

Remarks:-
1) When you use the above SELECT statement, the $$ItemSerial function returns random values and not the line serial number starting from 0 as in case of MASTERs.

2) RTSAllVouchers is a user-defined collection and its TDL code has been provided in my earlier post.

BUG:
It has been confirmed by Tally Solutions, Bangalore that the $$ItemSerial function generates (incorrect) random values when used with the VOUCHER object.

Please note that both Tally 7.2 and Tally 9 have the $$ItemSerial bug.

Thursday, October 11, 2007

CompanyVouchers collection

FAQs : Tally Integration using RTSlink DLL

When I use the CompanyVouchers collection, Tally Server returns vouchers for the current-date only.

CompanyVouchers is a pre-defined collection. The Collection definition is given herewith for your reference:-

[Collection: Company Vouchers]
Type : Voucher
Child of : ##SVCurrentDate
Report : Voucher
IsODBCTable : Yes

As you can see, this collection is filtered for the Current-date using the ChildOf attribute. Hence, it returns Vouchers for the current-date only.

To retrieve all Vouchers, you can use the RTSAllVouchers Collection.

Tuesday, October 9, 2007

XML tags to create Sales Voucher in Tally Software

Corrections
Minor changes have been done in the CreSale.xml file. It now includes XML tags for creating Unit master also.

Download the cresale.zip file

For other downloads, visit www.rtslink.com/downloads.html

Remarks:-
CreSale file contains XML tags to create a Sales Voucher programmatically using RTSlink DLL. Tested with Tally 7.2 an Tally 9

Monday, October 8, 2007

BAD PARSE Error

FAQ's :- Tally Integration using RTSlink DLL

I am getting "BAD PARSE" error while using the Send() function of RTSlink DLL

This post is applicable to Tally 9 or higher versions only.

Why does the BAD PARSE Error appear ?
The Tally Server responds with "BAD PARSE" error when it is enable to parse the XML request that you had sent using the Send() function. In simple words, it means that the XML tags that you used with the Send() function are incorrect.

Well, the Answer is as very simple "Check the XML tags". But does this really solve the problem. Yes and No, both. Confused, don't worry, continue reading-on.

Things worsen if somebody tells you that the XML tags are generated from Tally Software itself, by using Export option.

Now, let us try to understand the situation.

Case 1
1) Create a new Company and do a Voucher Entry (any voucher)
2) Use the option "Display -> Daybook -> Alt+E " to export the data. Keep the "Language" option as "Default (All Languages)" and export it in XML format.
The above will export the data into "Daybook.xml" file.

Try out using RTSlink DLL with the the XML tags generated in Daybook.xml file. This generates "BAD PARSE" Error.

Case 2
1) Use the option "Display -> Daybook -> Alt+E " to export the data. Set the "Language" option as "Restricted (Ascii) " and export it in XML format.
The above will export the data into "Daybook.xml" file.

Try out using RTSlink DLL with the XML tags generated in Daybook.xml file. It works.

What caused the problem in Case 1 ?
As you can see, in the 1st case we exported the data in "Default (All languages)" format which defaults to UNICODE format. In the Unicode format, each character occupies TWO bytes for storage as compared to ONE bytes in UTF-8 format (default for Tally 7.2 / 8.1).

Conclusion

When you export Tally data, ensure that the "Language" option is set to "Restricted (Ansii format)".

Thursday, October 4, 2007

VB.NET error : Attempting managed execution inside OS Loader lock

FAQ's - Tally Integration using RTSlink

I am trying to link my VB.NET application with Tally using RTSlink DLL. But I get this error while calling RTSOpen() function :-

"Attempting managed execution inside OS Loader lock. Do not attempt to run managed code inside a DllMain or image initialization function since doing so can cause the application to hang. "

Solution:-
1. Go to Debug/Exceptions
2. Open up the Managed Debugging Assistants node on the tree and scroll down till you find LoaderLock and uncheck it.

After this recompile the project.

Saturday, September 15, 2007

$Date vs $$Date

$Date - is an Internal method (i.e. field) of the VOUCHER Object.
$$Date - is a function that accepts a string parameter and returns date value.

Example:-

Select $Date,$VoucherTypeName,$Amount from RTSAllVouchers
where $Date = $$Date: '01-04-2007'

The above SQL-SELECT statement returns all Voucher records where the Date is '01-04-2007'. Please note that condition $Date = $$Date: '01-04-2007' wherein the 1st $Date refers to the Date field whereas the 2nd $$Date is a function.

Remarks:-
1) RTSAllVouchers is a user-defined Collection and the related TDL which defines it must be specified in the Tally.ini. Click here for more information on RTSAllVouchers.
2) RTSlink DLL v1.8 or higher supports SQL-SELECT. Click here on more information on how to use SQL-SELECT statement.

Tuesday, September 11, 2007

Support Services

This post attempts to clarify the 'Type and Extent of Support Services' provided by 'Shweta Softwares' for it's product RTSlink DLL.

Readers are invited to post their comments / views / suggestions to this post itself. Please mention your Name and City.

WHAT SUPPORT SERVICES WE OFFER FOR RTSLINK DLL

Point 1

Support services are provided for a period of 90 days
Remarks:-
Integrating an Application with Tally Software may require 3-4 weeks appx. This time duration depends upon various factors like the a) Time devoted by the Developer b) The programming experience of the Developer etc.

Support Services include access to password protected resources at our site and blog-site and this is limited to a period of 90 days.

Point 2
Queries are addressed within 24 to 48 hrs
Remarks:-
The average time has been less than 24 hours.

Point 3
Support services are provided by email
Remarks:-
Support services are normally provided by email. In demanding situations (which requires us to get lots-of-information from the Developer) we do provide support by Chat over Yahoo Messenger or Google Talk.

Point 4
Support services are cover the following :-
- Providing Basic guidelines for the Tally Integration process
- Providing guidance and sample codes for using the RTSlink DLL functions
- Providing guidance and sample XML tags to Create; Alter; Delete the Masters and Vouchers using RTSlink DLL
- Providing guidance and sample XML tags to Fetch Tally Reports data using RTSlink DLL
- Helping out in writing proper XML tags
- Helping out in TDL (to a certain extent)
- Access to XML Tags and TDL codes (which is provided to registered users only)

Point 5
Resources provided by Shweta Computers for it's product RTSlink DLL
- Instructions Manual, "RTSlink - An Insight" which covers detailed explanation of features like XML DOM
- XML tags at www.rtslink.com/TallyXMLTags.htm
- Software Registration utility for ONLINE or OFFLINE registration of the DLL

Shweta Computers, assures it best services and shall put all efforts to provide utmost satisfaction to its customers.

However, we would like to point out certain issues / things which are not covered under the Support services for our product RTSlink DLL. Here's it...

WHAT ALL IS NOT COVERED UNDER SUPPORT SERVICES FOR RTSLINK DLL


- Developing and providing customized TDL solutions as a part of RTSlink DLL package
- Developing and providing any other customized Program (Accounting or otherwise) as a part of the RTSlink DLL package
- Providing the source-code of the DLL
- Any sort of changes in the RTSlink DLL
- Customized solutions like demanding
"I have Software for Garments or Pharma Industry. Please provide me source-code of an accounting software for this particular industry with implementation of RTSlink DLL"

TDLplayground
Shweta Computers, has developed a blog-site tdlplayground, wherein it attempts to provide guidance and sample programs to Customize Tally Accounting Software using TDL (i.e. Tally Definition Language) FREE of cost.

Final Words
Business involves trust between Buyer and the Seller. And we are here to put the best of our efforts to WIN your trust.

POST YOUR VIEWS / COMMENTS / SUGGESTIONS
Readers are requested to post their views / suggestions along. Please mention your Name; city.

Sunday, September 9, 2007

XML tags for creating Masters and Vouchers in Tally Software

This post provides XML tags (ONE sample each) for :-

1) Creating; Altering; Deleting Masters in Tally Software
2) Creating; Altering; Deleting Vouchers in Tally Software


You can download and use these XML tags for evaluating our product RTSlink DLL. Please note that we have provided ONE sample for MASTER (i.e. Group master) and ONE sample for VOUCHER (i.e. Sales Voucher).

The XML tags given herein have been verified with Tally 7.2 and Tally 9.


XML tags for Masters

1) Download XML tags for Creating a Group named My Debtors"

2) Download XML tags for Altering Group
Remarks: The Parent group for "My Debtors" is changed to "Sundry Creditors" instead of Sundry Debtors

3) Download XML tags for Deleting the Group "My Debtors"

XML tags for Vouchers

1) Download XML tags for Creating Sales Voucher
Remarks: This Sales voucher requires Ledgers and Stock-items. Hence, we have included XML tags for the required Ledgers, Stock-items also. A Sales Voucher of Rs 100/- dt: 1-4-2007 is created using these tags. Also note that the Accounting period in your Tally company must be 1-4-2007 to 31-3-2008.

2) Download XML tags for Altering Sales Voucher
Remarks: The Sales voucher created earlier is now modified. The Amount is now changed to Rs 200/-.

3) Download XML tags for Deleting Sales Voucher
Remarks: The deletes the Sales voucher created earlier.

SAMPLE CODE for using the above Tags with RTSlink DLL

To evaluate RTSlink DLL and the XML Tags, sample codes has been provided in different programming languages as given below:-

1) VB.NET, C# and ASP.NET using C#
2) Visual basic
3) Visual Foxpro
4) Delphi

The above links use XML tags to create Group Master. You can substitute the XML tags and test the XML tags for Vouchers also.

POST your Opinion / View / Comments

Has 'Shweta Computers' provided REASONABLE number of sample codes (with XML tags) for evaluating their product RTSlink DLL in line with what other Business Houses are providing for evaluating their products ?

You may answer in Yes or No or can put your comments.
Please provide your a) Name c) City.

Please do not provide fiticious names like ABC (and if your name is really ABC, then please provide your Phone number as we would like to invite you for tea). We don't serve Coke, please excuse us.

Monday, September 3, 2007

ExplodeFlag tag does not work with "Bills Receivable" Report

ExplodeFlag tag does not work with "Bills Receivable" Report.

It has been confirmed by Tally Solutions, Bangalore that the above is a problem with Tally Software (Tally 7.2 & Tally 9).

Problem Description:-
ExplodeFlag is used to fetch / export data in Detailed format. It works fine with reports like "Trial Balance", "Balance Sheet" but does not work with report "Bills Receivable".

My Query to Tally Solutions has been given underneath for your reference:-

a) I am trying to use ExplodeFlag=Yes xml-tag to retrieve the "Bills Receivable" report data in Detailed format, but am getting the report output in Condensed format.
File attached (Receivables.xml)

b) When I tried ExplodeFlag=Yes with other Reports like "Trial Balance", it works fine and I get the Result in Detailed format.
File attached (TB1.xml)

c) Next, I tried to manually export both the Reports mentioned above viz. "Bills Receivable" and "Trial Balance" using the Tally 7.2 Software

Try out the following to understand my query:-

SITUATION ONE (Tally 7.2 Release 3.12)

Export Trial Balance in Condensed XML
1) Use option "Gateway of Tally -> Trial Balance" to display it.
2) Now, press "Ctrl+E" to export the Trial Balance. Select the format as Condensed; XML format.
3) View the XML output generated.

Export Trial Balance in Detailed XML
1) Use option "Gateway of Tally -> Trial Balance" to display it..
2) Now, press "Ctrl+E" to export the Trial Balance. Select the format as Detailed; XML format.
3) View the XML output generated.

RESULT: You can see that the output is different in both the cases. You will get correct output in both the cases.

SITUATION TWO (Tally 7.2 Release 3.12)

Export Bills Receivable in Condensed XML
1) Use option "Gateway of Tally -> Display -> Statement of Accounts -! > Outstanding -> Receivables" to display the Bills Receivable report.
2) Now, press "Ctrl+E" to export it. Select the format as Condensed; XML format.
3) View the XML output generated.

Export Bills Receivable in Detailed XML
1) Use option "Gateway of Tally -> Display -> Statement of Accounts -> Outstanding -> Receivables" to display the Bills Receivable report.
2) Now, press "Ctrl+E" to export it. Select the format as Detailed; Show Qty Info as Yes; XML format.
3) View the XML output generated.

RESULT: Notice that the XML output in case of Bills Receivable is same in both the cases, whether we select Detailed or Condensed.

The same happens when we programmatically use EXPLODEFLAG=YES to fetch the Bills Receivable report, but the output is always in condensed format.

Conclusion:-
ExplodeFlag=Yes when used with Trial-Balance works fine, but does not work with "Bills Receivable"

Monday, August 27, 2007

Recycle bin for Tally Software with Source code

Recycle bin is a FREE add-on utility for Tally Software.

It enables you to retrieve Voucher entries that you may have accidentally deleted in Tally Software. It is similar to the Windows recycle-bin and works with Tally 7.2 and Tally 9.

Supports Tally 7.2 and Tally 9 Software.

View/Download the Recycle bin TCP Source-code.

Saturday, August 11, 2007

Tally Integration

Tally Integration


Here's all that you wanted to know about Tally Integration at one place :-
www.rtslink.com/Tally-Integration-Tally-Customization.html

What all it covers:-
VFP to Tally (incl Foxpro 2.6 to Tally)
VB to Tally
VB.NET to Tally
C# to Tally
ASP.NET to Tally
Code to Import Sales Voucher from your Application into Tally
Code to Import Receipt Voucher from your Application into Tally

Thursday, August 9, 2007

Tally 9

You can Download Tally 9 Demo version from here.

Tally Integration
Use RTSlink DLL to read or write Tally data. Works with VB to Tally, VFP to Tally, VB.NET to Tally, C# to Tally, ASP.NET (with C#) to Tally.
For more information, visit www.rtslink.com

Tally Customization
Learn TDL - Tally Definition Language at tdlplayground.blogspot.com

Tags:-
Tally 6.3, Tally 7.2, Tally 8.1, Tally 9 or higher.

Saturday, August 4, 2007

ASP.NET to Tally, VB.NET to Tally, C# to Tally

RTSlink DLL can be used in .NET platform to read or write Tally Software data (works with Tally 6.3, Tally 7.2, Tally 8.1, Tally 9 or higher). Sample code has been provided for using the DLL in C#, VB.NET and ASP.NET with C#.

For more information, refer www.rtslink.com

C# - Download sample code for using RTSlink DLL in C#
VB.NET - Download sample code for using RTSlink DLL in VB.NET
ASP.NET with C# - Download sample code for using RTSlink DLL in ASP.NET (with C# or VB.NET)

Please note:-
RTSlink DLL can be used in ASP.NET (with C# or VB.NET) web-based projects in a Local Area Network only. For deploying solutions on a Remote Server, we can provide customized solutions for .NET platform or Java.

Wednesday, July 4, 2007

Can I have Tally Software on a different machine, other than that on which RTSlink DLL is installed ?

Yes. You can have Tally Software on one machine and RTSlink DLL on a different system and still use the DLL to read/write Tally data.

For this you need to create a plain text file named RTSLINK.INI in your Software Application folder which contains the following text:-

[Tally]
Server=192.168.1.1

Remarks:-
Substitute the IP-Address given above with the IP-Address of machine in which Tally Software is installed.

Sunday, July 1, 2007

Fetch Tally Voucher data including Stock-Item details

This post illustrates how to fetch Tally Voucher data including Item-Name, Item-Qty, Item-Rate using the SQL-SELECT statement.
(SQL-SELECT works with RTSlink v1.8 or higher)


Using Wrapper EXE to invoke SQL-SELECT statement
1) Create a TXT file (say SQL1.TXT) which contains the following code:-

SELECT $Date,$VoucherTypeName,$VoucherNumber,$Amount,
$$FullList:InventoryEntries:$StockItemName,
$$FullList:InventoryEntries:$BilledQty,
$$FullList:InventoryEntries:$Rate
FROM RTSAllVouchers

2) Go to DOS Command-prompt and change to "C:\RTSLINK" folder.
3) Next, type the following command :-


WRAPPER SQL1.TXT /SQL


4) Check for the output in RESPONSE.LOG file.

Using the DLL in Visual Basic, VFP or any Win32 application
Syntax : SQLRequest( <SQL-SELECT statment>)
Remarks : Substitute the SELECT statement as given in the Wrapper exe sample.

Notes:
1) $$FullList is a Tally Internal Function. It
processes the given Collection and returns the Field data.
Syntax : $$FullList : <CollectionName> : <Method/ FieldName>
Return Value : String

2) InventoryEntries is a pre-defined Collection. It stores the Stock-Item related information for Tally Vouchers.
3) Date, VoucherTypeName,VoucherNumber,Amount are Fields (also called Methods) of the VOUCHER Object. To fetch Fields/Method data, they are to be pre-fixed by $ sign.


Monday, June 25, 2007

Introducing RTSlink v1.9

RTSlink v1.9 comes with a new function SQLDelete() that allows you to use SQL-DELETE statement to delete Tally Masters and Vouchers. For more information refer Using SQLDelete() function

Friday, June 22, 2007

Working with User-Defined-Collections

This post illustrates how to fetch data from User-defined-Collection (MyStatistics) which is created in program TDL26. For information on program TDL26, visit tdlplayground.blogspot.com


Usage:-

SQLRequest("Select $AllLegers,$DebtorsLedgers,$CreditorsLedgers from MyStaistics")

Using WRAPPER.EXE:-
1) Create a TXT file (say Test.txt in C:\RTSLINK folder) that contains the following SQL-SELECT statement:-
Select $AllLegers,$DebtorsLedgers,$CreditorsLedgers from MyStatistics

2) Go to DOS-prompt and change to C:\RTSLINK folder.
3) Type out the following command:-
   WRAPPER    TEST.TXT   /SQL

Notes:-
1) Wrapper.exe is shipped with RTSlink DLL
2) You must have RTSlink (Original or Demo version) installed in your system.

Wednesday, June 20, 2007

User-Defined Collection - RTSAllVouchers

RTSAllVouchers is a User-defined collection that we shall be using in many of our programs. Hence, the source code is once again provided herewith for your reference:-

;; PRODUCT: RTSAllVouchers
;; PRODUCT-ID: cc307cfa-1d7f-4f9a-92f8-xde60a2943be
;; AUTHOR: Shweta Computers
[Collection: RTSAllVouchers]
Type: Voucher
IsODBCTable: Yes
Notes:-
1) Create a plain TXT file using Notepad with the above code.
2) Copy the file to C:\Tally folder.
3) Make changes in Tally.ini for include the above file. Refer the article "How to use plain TXT files to customize Tally ?" for more information.

Wednesday, June 13, 2007

How to Count Number of Ledgers in Tally Company ?

At times we need to Count the number of records in a given Collection (i.e. Table). This can be done by using SQLRequest() function of RTSLink DLL.

The underneath statement shows how to fetch number of Ledgers :-

SQLRequest("Select $$NumItems:LEDGER from Ledger where $$ItemSerial=1")

Now let us try to understand the above SELECT statement.

1) $$NumItems is an Internal Tally function. It returns the Number of items in the specified Collection.

Syntax:-
$$NumItems: <CollectionName>

The $$NumItems function is passed a Collection-Name, and it returns the number of Objects (records) in the LEDGER collection.

2) Why do we use the $$ItemSerial function ?

First of all, let us understand the functionality of $$ItemSerial function. It does not require any parameter and returns the number of records (lines) processed starting from 0. In simple words, if there are 5 Ledgers master records in the LEDGER collection, the $$ItemSerial will return 4.

Now, using $$ItemSerial=0 in the WHERE clause of the SELECT statement, will return a single row of information (i.e. the Ledger-Count). Try removing the WHERE clause and notice the difference.

It works the same way for other masters too. Example:-

Select $$NumItems:STOCKITEM from StockItem where $$ItemSerial=0

Thursday, June 7, 2007

Error Msg: Date 0-0--1900 is out of range

The above error message generally appears in the following cases:-

1) When you use XML tags to write a Voucher to Tally and the Voucher date is lesser than the Books beginning date in the Tally Company.

2) When you specify a date other than 1st or 2nd, and Tally is running in educational mode. In then Tally Education mode, you can enter vouchers for the 1st or 2nd of any month.

Tuesday, June 5, 2007

Using SQL-Select in Visual Basic to fetch Tally Data

For information, click "Using SQL-Select to fetch Tally Data from VB"

A common mistake in VB

One common problem faced by many programmers while using DLL functions in Visual Basic is NOT specifying the ByVal for String Parameters.

Correct Declaration
Declare Function SQLRequest Lib "RTSLINK.DLL" (ByVal strSQL As String) As Long

Incorrect Declaration
Declare Function SQLRequest Lib "RTSLINK.DLL" (strSQL As String) As Long

Remarks:-
By default, parameters are passed by Reference in Visual Basic. If you need to pass the parameter ByVal, it has to be explicitly specified using the ByVal keyword.

Please note that the String parameters are to be always passed ByVal to DLL functions.

Friday, June 1, 2007

Introducing RTSlink DLL v1.8

RTSlink DLL v1.8 now comes with a new function SQLRequest() that allows you to use SQL-SELECT statements to fetch Tally data. You can fetch both Masters or Vouchers data including the Item-details and Ledger-details using simple SQL-SELECT statements. Example:-

a) Select $Name,$ClosingBalance from LEDGER
b) Select $Name from STOCKITEM order by $Name

For more informaion, visit www.rtslink.com

Online Registration of RTSLINK DLL License
RTSlink v1.8 comes with a Software Licensing module that allows you to Register or Surrender the RTSLINK DLL license either ONLINE or OFF-LINE.

Saturday, May 19, 2007

Using RTSLINK DLL in VB.NET

PInvoke is the mechanism by which .NET languages can call unmanaged functions in DLLs. This is especially useful for calling Windows API functions that aren’t encapsulated by the .NET Framework classes, as well as for other third-party functions provided in DLLs.

Using PInvoke in VB.NET to call RTSLINK DLL functions

There are mainly two ways in which you can use PInvoke in VB
1) Using the Declare Statement
2) Using DllImport

Using the Declare Statement
Declare Auto Function RTSOpen Lib "RTSLINK.DLL" Alias "Open" () As Long
Declare Auto Function Send Lib "RTSLINK.DLL" (ByVal strRequestXML As String) As Long
Declare Auto Function GetLastErrorMessage Lib "RTSLINK.DLL" () As String

Remarks:-
For more information on using PInvoke in VB.NET, please refer the article at CodeProject

Friday, April 20, 2007

Analyzing the Tally Server Response

RTSLINK DLL

This article describes how to read the Tally Server Response after a XML request is sent using the Send() function. To begin with, let us see the C language declaration of the Send() function.

C language declaration of the Send() function
int __stdcall Send(message);

Remarks:-
  1. The send function returns an Integer value (Zero for success, otherwise the error-code).
  2. If the return value is Zero, it implies that the XML request has been successfully sent to the Tally server.

Analysing the Tally Server Response
As mentioned above, if the Send() function returns 0 (Zero), it implies that the XML Request has been successfully sent to the Tally Server. The XML requested can be either reading or writing data to the Tally' database. Example of XML Request:-
  1. Export (read) any report data (Trial balance, Ledger etc.)
  2. Import (write) any master or voucher data to Tally's database
On receiving the XML Request message, the Tally Server processes it and then delivers a response/result which can be retrieved using the ResponseText() function which is described later on. Example:-
  1. If you had requested for any Report, the Tally Server response will contain the Report data.
  2. If you had requested for writing data to Tally's database, the Tally Server response will contain details whether a new records is created; or altered or deleted.
In the later case, when the XML request is to write to Tally's database, it becomes essential to analyze the Tally Server response and check for errors. For this the ResponseText() function is to be used. The ResponseText() function retrieves the Tally Server response and returns it in a string.

C language declaration of ResponseText() function
LPSTR __stdcall ResponseText(void);

You can either display the response message in a Message-Box or parse it using XML DOM. Use the following VB code to parse the response message and check if any errors are there or not.

Sample VB code
Set ChildNodes = XMLDOM.SelectNodes("/RESPONSE/LINEERROR")
if (ChildNodes.Length > 0) then
MsgBox "Tally write error"
else
MsgBox "Success"
end if

For more information about using XML DOM, please refer the topic "Using XML DOM" in "RTSlink - An Insight" document which can be downloaded from www.rtslink.com/downloads.html


Shweta Computers
www.rtslink.com

Tuesday, April 17, 2007

Creating customized Tally Reports - MyDaybook v1.3

MyDaybook version 1.3  supercedes the older version 1.2.

The new features in MyDaybook version 1.3 are as follows:-
1) Allows you to Delete multiple Voucher entries

Click here  for more information on MyDaybook v1.3.

Monday, April 16, 2007

Tally Customization - Linking Sales Voucher module with Tally Software

Tally Customization - How to link Sales Voucher entry module with Tally Accounting Software ?

Click here for more information.

Tuesday, April 10, 2007

Linking Receipt Voucher entry module with Tally

Click here for more information on linking the Receipt module of your software with Tally.

Wednesday, March 7, 2007

Export / Fetch Tally data programmatically

Click here for information about Exporting Tally data programmatically using XML Tags.

Thursday, February 15, 2007

Linking Ledger Master module with Tally

LEDGER.EXE is a Master Entry form developed by Mr Vikas Aggrawal, Ahmedabad. This program has been developed in Visual Foxpro 6 and demonstrates how you can link your application with Tally Accounting Software.

Notes
Entries done in this VFP form are automatically posted in Tally. Full source-code of LEDGER.EXE (1991 kb) is provided. The source-files include:-

1) Ledger.pjx and Ledger.pjt (Project file)
2) Ledger.scx and Ledger.sct (Form)
3) Main.prg (Main Program file)
4) Sclib.prg (Program file)
5) Ledger.dbf (VFP Table)
6) Party.dbf
7) Group.scx and Group.sct

To run LEDGER.EXE file, you need RTSLINK DLL.

Click here to download the RTSlink DLL setup-file.

Click here to download the LEDGER.EXE file.

Friday, February 9, 2007

Group Master Entry form

GROUP.EXE is a Master Entry form developed by Mr Vikas Aggrawal, Ahmedabad. This program has been developed in Visual Foxpro 6 and demonstrates how you can link your application with Tally Accounting Software.

Notes
Entries done in this VFP form are automatically posted in Tally. Full source-code of GROUP.EXE (1983 kb) is provided. The source-files include:-

1) Group.pjx and Group.pjt (Project file)
2) Group.scx and Group.sct (Form)
3) Main.prg (Main Program file)
4) Sclib.prg (Program file)
5) Group.dbf (VFP Table)

To run GROUP.EXE file, you need RTSLINK DLL.

Click here to download the RTSLINK DLL setup-file.

Click here to download the GROUP.EXE file.

Thursday, February 8, 2007

Good Programming Practices

1. Start with a good program design.
2. Your program should be functional at all times. Adding new functionality should not break the existing functionality.
3. Divide the work into small incremental steps such that you can accomplish and review it within a single day.
4. Review each line of your code.
5. Adopt top-bottom approach.

Linking your Software with Tally

I am not a programmer. Can I use the RTSLINK Utility ?
RTSLINK DLL utility is for Programmers / Software developers who have developed their own software and wish to link it with Tally.

What does "Linking with Tally" mean ?
Suppose, you do a Payment Voucher entry (or any other voucher) in your program. Automatic Posting of this entry into the Tally software is what we call "Linking with Tally". In other words, any entry added / modifed or deleted in your software must be automatically reflected in Tally. (Note: Tally software must be running in background)

Can I post data from my software into Tally directly ?
Yes. This is already dicussed in the previous point.

How do I link my software with Tally ?
You will have to modify the SAVE module of all the Entry/Transactions screens in your program. Although this is not very difficult, but it may take few days/weeks as there may be several modules in your program. You will be linking only the "Accounts & Inventory" modules of your program with Tally.

Proper planning and a systematic approach can ease this task. Let us try to understand what needs to be done in the SAVE modules of your software.

STEP 1: SAVE module of your program
Data entered by the User is to be saved into the database.

It is presummed that the developer has a functional program with complete module to SAVE the data into the database. We shall move to the Step 2 of the SAVE module which is generating Tally supported XML tags.

STEP 2: SAVE module of your program
At the end of the SAVE module, write code to generate Tally supported XML tags. These tags will be different for each module.

Generating the XML tags
The first thing you must do is to refer the Tally supported XML Tags for the module you wish to link. Suppose you wish to link GROUP Master module of your software with Tally, you need to have the XML tags for the GROUP master. You can get this from the Tally Software itself using option "Display -> List of Accounts -> Export" or you may download it from www.rtslink.com/downloads.html

We are providing sample XML Tags for GROUP master.


<ENVELOPE>
<HEADER>
<TALLYREQUEST>Import Data</TALLYREQUEST>
</HEADER>
<BODY>
<IMPORTDATA>
<REQUESTDESC>
<REPORTNAME>All Masters</REPORTNAME>
</REQUESTDESC>
<REQUESTDATA>
<TALLYMESSAGE xmlns:UDF="TallyUDF">
<GROUP NAME="My Debtors" ACTION="Create">
<NAME.LIST>
<NAME>My Debtors</NAME>
</NAME.LIST>
<PARENT>Sundry Debtors</PARENT>
<ISSUBLEDGER>No</ISSUBLEDGER>
<ISBILLWISEON>No</ISBILLWISEON>
<ISCOSTCENTRESON>No</ISCOSTCENTRESON>
</GROUP>
</TALLYMESSAGE>
</REQUESTDATA>
</IMPORTDATA>
</BODY>
</ENVELOPE>


Having seen the XML tags, you need to write code for it. We are herewith providing VISUAL BASIC code that stores the GROUP MASTER XML Tags into a string variable. This string variable is passed as a parameter in the Send() function.
Visual Basic code

Dim strRequestXML As String
Dim strAction As String
strAction="Create"

strRequestXML = _
"<ENVELOPE>" & _
" <HEADER><TALLYREQUEST>Import Data</TALLYREQUEST></HEADER>" & _
" <BODY>" & _
" <IMPORTDATA>" & _
" <REQUESTDESC>" & _
" <REPORTNAME>All Masters</REPORTNAME>" & _
" </REQUESTDESC>" & _
" <REQUESTDATA>" & _
" <TALLYMESSAGE>" & _
" <GROUP NAME=" & Form1.txtName.Text & "ACTION=" & strACTION & ">" & _
" <NAME.LIST>" & _
" <NAME>" & Form1.txtName.Text & "</NAME>" & _
" </NAME.LIST>" & _
" <PARENT>" & Form1.cmbParent.Text & "</PARENT>" & _
" </GROUP>" & _
" </TALLYMESSAGE>" & _
" </REQUESTDATA>" & _
" </IMPORTDATA>" & _
" </BODY></ENVELOPE>"


Notes:
You will have to subsitute the object names "Form1", "txtname", "cmbParent" etc in your code.

STEP 3: SAVE module of your program
- Connect to the Tally Server using Open() function of RTSLINK DLL.
- Invoke RTSLINK Send() function to send the XML tags (string) to the Tally server.

Notes:
1) Please refer the Visual basic Example 1 given in www.rtslink.com/visualbasic.html for the syntax to use RTSLINK DLL functions.
2) You will have to declare RTSLINK DLL functions before you can use them. This is covered in the Example 1 in www.rtslink.com/visualbasic.html


CONCLUSION
You have seen how to link GROUP MASTER module of your Software with Tally Software. The most critical thing in linking with Tally is to create the XML Tags and store it in a STRING variable.

You may try creating XML Tags for other Masters on the same lines. Creating XML tags for Vouchers (transactions) is comparatively difficult as compared to Masters. We would suggest that you complete all the MASTERS linking and then proceed with the Transactions.

FINAL WORDS
We would request programmers / software developers to provide sample code written in other programming languages for linking with Tally. The code will be put on this blogspot for the benefit of all interested programmers.

Friday, January 26, 2007

Introduction to RTSlink

RTSlink is a DLL (Dynamic Link Library) that allows software developers to integrate their Applications with Tally 7.2. or higher.

RTSLink works on Windows 2000 and later versions and can be used with any Win32 application viz. Visual Basic, Visual Foxpro, Delphi, MS-Access applications. For using RTSlink with Foxpro 2.6 (DOS), you have to use Wrapper.exe provided along with RTSlink.

Tally uses the SOAP protocol and XML to exchange data with other applications. To work with RTSLink DLL, you need to have a basic understanding about XML and XML tags.

Click here for a one minute guide to XML.

Click here for a one minute guide to SOAP.


Functions available in the DLL

Open()
Creates / opens a connection to the [Tally] server application. If the connection is successful, a zero value is returned. If the connection fails, the error code number is returned.
Send()
Sends a request to the [Tally] Server in form of XML message/tags.
ResponseText()
Reads the [Tally] Server application response.
GetLastErrorMessage()
Retrieves the last Error Message text.

Additional functionality
Most of the time, you will be using the core functions viz. Open(); Send(); ResponseText() ; GetLastErrorMessage() in your code. However, to provide more flexibility to the programmer, some additional functionality has been provided.

You may use these functions as an alternative to the send() function.
Method 1: Use SendXMLFileToServer() to send a XML file to Tally
Your application should create a XML file that contains the required XML tags. Next, invoke the SendXMLFileToServer() function to write this file to [Tally] server application. For more information, refer to the section Using DLL in your
application.
Method 2: Use AddXMLTag() & SendXMLTagsToServer()
Alternatively, your application may invoke the AddXMLTag() function several times to write all the Tags you want. These tags are stored temporarily in memory. After this, you must invoke the SendXMLTagsToServer() function to write these tags to [Tally] server. For more information, refer to the section Using DLL in your application.