Special Character (#) in Ledger Name, Bad Formula Error for Requesting Ledger Outstanding using XML

Discussion in 'Tally Integration' started by Bhushan Cellica, Oct 15, 2019.

    

  1. Hello All,

    I am trying to export Ledger Outstanding of some of Ledgers from Tally ERP 9 using XML Request.
    All works well as expected.
    But if Ledger Name has special character say hash(#) then Tally fails with "Bad Formula" Error.

    Request XML i am sending to Tally ERP 9 is

    Code:
    <ENVELOPE>
       <HEADER>
         <TALLYREQUEST>Export Data</TALLYREQUEST>
       </HEADER>
       <BODY>
         <EXPORTDATA>
           <REQUESTDESC>
             <REPORTNAME>Ledger Outstandings</REPORTNAME>
             <STATICVARIABLES>
               <SVCURRENTCOMPANY>Demo Company</SVCURRENTCOMPANY>
               <SVEXPORTFORMAT>$$SysName:xml</SVEXPORTFORMAT>
               <LEDGERNAME>#Abc</LEDGERNAME>
             </STATICVARIABLES>
           </REQUESTDESC>
         </EXPORTDATA>
       </BODY>
    </ENVELOPE>
    
    Please reply soon.

    Thanks,
    Bhushan Akole.
     


  2. teja varma

    teja varma Active Member


    put ledger name inside single quotes
    <ENVELOPE>
    <HEADER>
    <TALLYREQUEST>Export Data</TALLYREQUEST>
    </HEADER>
    <BODY>
    <EXPORTDATA>
    <REQUESTDESC>
    <REPORTNAME>Ledger Outstandings</REPORTNAME>
    <STATICVARIABLES>
    <SVCURRENTCOMPANY>Demo Company</SVCURRENTCOMPANY>
    <SVEXPORTFORMAT>$$SysName:xml</SVEXPORTFORMAT>
    <LEDGERNAME>'#Abc'</LEDGERNAME>
    </STATICVARIABLES>
    </REQUESTDESC>
    </EXPORTDATA>
    </BODY>
    </ENVELOPE>
     



  3. Thanks for you reply.

    I already tried single quotes and its working properly.

    But the problem arise when Ledger name itself has "Single Quote" or "double Quote"

    Thanks,
    Bhushan Akole.
     


  4. teja varma

    teja varma Active Member


    that because if you specify ledgername tally will treat it as 'legdername'
    so if ledger contains single or double quotes it will become ''ledgername' / '"ledgername' it will end up as invalid format because quotes are not closed properly
    if we encode or replace with &quot; or &apos; it will also end up in the same error
    so the way i found is create a collection and add filter option to that collection
    use that collection to make your report with whatever fields you want
     



  5. Thanks for your reply i will try and update you on it.

    Thanks,
    Bhushan Akole
     


  6. HVPatel

    HVPatel Active Member


    Hi sir,
    how can we use &quot; (") with a sentence, i creating a notepad batch file using TDL and its requires " before and after some words.
    if you have any example, please provide.
     


  7. Amit Kamdar

    Amit Kamdar Administrator Staff Member


    "This is how to " + $$StrByCharCode:34 + "insert" + $$StrByCharCode:34 + "characters"

    xx.PNG
     
    gangstar likes this.


  8. HVPatel

    HVPatel Active Member


    Thanks, it worked and meanwhile Tally TDL Desk Support provided a Solution as below;

    Set As : "This is a Special Addon Named "+ ' " ' + "TallyPlus" + ' " ' +" from Patel Software"

    Both is worked.
     


Share This Page