简体   繁体   中英

Tally ERP 9 XML XTTP Data export

I was trying to Export Data from Tally ERP 9 via XML HTTP via localhost:9000. I am getting XML File with ASCII data. This causes many symbols with '?'. Like Ruppee symbol and Euro symbol. Is there any way to export data in Unicode?? The POC used was

import httplib
c=httplib.HTTPConnection('localhost:9000')
headers = {"Content-type": "text/xml;charset=UTF-8", "Accept": "text/xml"}
params = """<ENVELOPE>
        <HEADER>
        <TALLYREQUEST>Export Data</TALLYREQUEST>
        </HEADER>
        <BODY>
        <EXPORTDATA>
        <REQUESTDESC>
        <REPORTNAME>List of Accounts</REPORTNAME>
        <STATICVARIABLES>
        <SVEXPORTFORMAT>$$SysName:XML</SVEXPORTFORMAT>
        <ACCOUNTTYPE>Ledgers</ACCOUNTTYPE>
        <ENCODINGTYPE>UNICODE</ENCODINGTYPE>
        </STATICVARIABLES>
        </REQUESTDESC>
        </EXPORTDATA>
        </BODY>
        </ENVELOPE>
        """


c.request("POST", "/", params, headers)
r=c.getresponse().read()

fl=file("d:/xtemp.xml","w")
fl.write(r)
fl.close()

This seems more like an issue with your system fonts rather than Tally.

Make sure you have Rupakara font installed which has the unicode translation for the rupee symbol. Get it here.

To retrieve UNICODE data from Tally ERP 9, you must add the following headers to the HTTP POST request.

Syntax

XMLHttpRequest.setRequestHeader(header, value)

HTTP Headers to Export Tally data in UNICODE format

XMLHttpRequest.setRequestHeader('UNICODE', 'YES')

XMLHttpRequest.setRequestHeader('Content-Type', 'text/xml; charset=unicode')

Knowledge base : https://www.rtslink.com

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM