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

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)".

No comments: