Simple Invoice Export not working

Discussion in 'Tally Developer' started by torsky, Jan 12, 2019.

    
  1. torsky

    torsky New Member


    Hello!

    I'm trying to automatically export invoice voucher after the user clicks accept.

    Following is the very simple code. But after the execution, nothing actually happens. Can anyone please point me in right direction?

    Code:
    [#Form: Sales Color] 
    
    Add : On : At End : Form Accept : Yes : CALL : export
    On:Form Accept:Yes:Form Accept 
    
    [Function : export]
    
    010:SET: SVExportLocation:"D:\tallyexports\New folder"
    060:SET : SVExportFileName:"test.pdf"
    072: SET: SVExportFormatVar:$$SysName:PDF
    084:SET : SVExportFormat:$$SysName:PDF
    090:Action:Export
     


  2. Amit Kamdar

    Amit Kamdar Administrator Staff Member


    Try This..........

    Code:
    [#Form: Sales Color]
    On : Form Accept : Yes : CALL : export
    
    [Function : export]
    
    010:SET: SVExportLocation:"D:\tallyexports\New folder"
    060:SET : SVExportFileName:"test.pdf"
    072: SET: SVExportFormatVar:$$SysName:PDF
    084:SET : SVExportFormat:$$SysName:PDF
    090:Export Report: .    : True
     
    ONKAR likes this.


  3. ONKAR

    ONKAR Active Member


    @Amit Kamdar sir, I want to send this to direct to WhatsApp like invoice as JPEG FORMAT
     


  4. Amit Kamdar

    Amit Kamdar Administrator Staff Member


    replace PDF with jpeg
     
    ONKAR likes this.


  5. Jay kumar tailor

    Jay kumar tailor Well-Known Member


    Code:
    [Function: SALES Export Report]
    
    10: SET : SVExportLocation : "D:\Tally Exported Vouchers"
    20: SET : SVExportFormat :$$SysName:JPEG(Image)
    30: Set : SVPrintFileName : $$String:$Vouchertypename+"_"+$$String:$vouchernumber
    40: SET : SVPrintFileName : $$MakeExportName:##SVPrintFileName:##SVExportFormat
    50: Set : SVPrintFileName :##SVExportLocation+"\"+#SVPrintFileName
    60: EXPORT REPORT : . : TRUE
     
    ONKAR likes this.


  6. ONKAR

    ONKAR Active Member


    @Amit Kamdar sir and @Jaykumartailor sir, I know this, my point is, this code can save this invoice directly to the desired folder but I want to export/send directly to WhatsApp to a specific number, so how to send an invoice to WhatsApp ??
     


  7. Amit Kamdar

    Amit Kamdar Administrator Staff Member


    Make another function........
    the above function saves the file in JPEG to a folder...... make that filepath and filename into a variable.
    then the second function will send the file to the whatsapp. (use the variable from above function)

    Both the above TDL are available separately in this forum.......... so you need to perform a marriage/merger of the two.
     
    ONKAR likes this.


  8. ONKAR

    ONKAR Active Member


    :D
     


  9. Bipin Damania

    Bipin Damania Active Member


    Amitji, Jayji

    Getting Error..

    Error in TDL.

    'Form:printed Invoice'

    Vertical Page Breaks are too big!

    Please reply.
     


  10. Amit Kamdar

    Amit Kamdar Administrator Staff Member


    in PDF or Jpeg ???
     


  11. Bipin Damania

    Bipin Damania Active Member


    Amitji

    For both getting same error...

    Please reply.
     
    ONKAR likes this.


  12. ONKAR

    ONKAR Active Member


    @Bipin Damania sir do you have completed this code, so we can send sales to invoice directly to WhatsApp
     


  13. ONKAR

    ONKAR Active Member


    @Amit Kamdar sir , like this sir


    [#Form: Sales Color]
    Add : Button : WhatsApp

    [Button: WhatsApp]
    Key : Alt + W
    Action :Browse URL : "http://web.whatsapp.com/send?Phone=" + @@mobileno


    [System: Formula]
    Mobileno :$$String:"91" + $Ledgermobile:Ledger:$Ledgername


    [Function: SALES Export Report]
    10: SET : SVExportLocation : "D:\Tally Exported Vouchers"
    20: Set: SVExportFormat : $$SysName: JPEG(Image)
    30: Set: SVPrintFileName: $$String:$PartyLedgerName + "_" + $$String:$vouchernumber + "_" + $$String:$Vouchertypename
    40: Set: SVPrintFileName: $$MakeExportName:##SVPrintFileName:##SVExportFormat
    50: Set : SVPrintFileName :##SVExportLocation+"\"+#SVPrintFileName
    60: EXPORT REPORT : . : TRUE

    [System : Formulae]

    SVPrintFileName : $$ApplicationPath + "\D:\Tally Exported Vouchers\"

    [Function : Accounting Voucher]

    Variable : SVExportLocation : "D:\Tally Exported Vouchers : String
     


  14. Bipin Damania

    Bipin Damania Active Member



    Onkarji

    Not creating JPEG(Image) file of define path i.e. D:\Tally Exported Vouchers and also not sending to Whatsapp No too...

    Please check & reply.
     


  15. ONKAR

    ONKAR Active Member


    yes sir, thats why I asked @Amit Kamdar sir, is it right or wrong because I can't understand the exact formula
     


  16. ONKAR

    ONKAR Active Member


    @Amit Kamdar sir please help us

    [#Form: Sales Color]
    Add : Button : WhatsApp

    [Button: WhatsApp]
    Key : Alt + W
    Action :Browse URL : "http://web.whatsapp.com/send?Phone=" + @@mobileno


    [System: Formula]
    Mobileno :$$String:"91" + $Ledgermobile:Ledger:$Ledgername


    [Function: SALES Export Report]
    10: SET : SVExportLocation : "D:\Tally Exported Vouchers"
    20: Set: SVExportFormat : $$SysName: JPEG(Image)
    30: Set: SVPrintFileName: $$String:$PartyLedgerName + "_" + $$String:$vouchernumber + "_" + $$String:$Vouchertypename
    40: Set: SVPrintFileName: $$MakeExportName:##SVPrintFileName:##SVExportFormat
    50: Set : SVPrintFileName :##SVExportLocation+"\"+#SVPrintFileName
    60: EXPORT REPORT : . : TRUE

    [System : Formulae]

    SVPrintFileName : $$ApplicationPath + "\D:\Tally Exported Vouchers\"

    [Function : Accounting Voucher]

    Variable : SVExportLocation : "D:\Tally Exported Vouchers : String
     


  17. kishan369

    kishan369 New Member


    how to direct email form below code. this are not working please fix it..



    [#Form: Sales Color]
    On : Form Accept : $$InAlterMode : CALL : CRS AutoSyncCall
    On : Form Accept : $$InCreateMode : CALL : CRS AutoSyncCall
    Button:b14
    ;;; Function Definition begins
    ;
    [Function: send mail report]

    05:Trigger Key:F9
    ;10:Set:MailAddr:spectrumjohnson2018@gmail.com
    ;20:Set:SVSendToVar:"kishankalavadiya@gmail.com"
    ;30:Set:SVMailSubject:$VoucherNumber
    ;40:Set:MailText:$VoucherNumber
    ;50:MAIL : PRINTED INVOICE: YES
    ;60:SET :SVmailFormat : $$SysName:pdf
    ;70:Set :SVMailAttachFileName: $$String:$vouchernumber + ".pdf"


    ;50:Set:UserName:"spectrumjohnson2018@gmail.com"
    ;60:Set:UserPwd:"cjnwypbxtqeqwyfa"
    ;80:Mail Report:.:True
    /*
    10: SET : SVExportLocation : "E:\Tally Sales Invoice"
    20: SET : SVExportFormat : $$SysName:pdf
    30: Set : SVPrintFileName : $$String:$Vouchertypename+"_"+$$String:$vouchernumber
    40: SET : SVPrintFileName : $$MakeExportName:##SVPrintFileName:##SVExportFormat
    50: Set : SVPrintFileName :##SVExportLocation+"\"+#SVPrintFileName

    10:Set: MailAddr :"kishankalavadiya@gmail.com"
    20:SET : LedgerEmailID : $EMail:Ledger:##LedgerName
    30:Set :


    60: Mail Report: . : TRUE
    ;;; End of File
    */


    [button:B14]
    Title:$$LocaleString:"prism email"
    Key:F9
    Action:Trigger Key:CTRL+m,spectrumjohnson2018@gmail.com,enter,$email,enter,$VoucherNumber,enter,enter



    [Function : CRS AutoSyncCall]

    100 : Query Box : "Do u want to Send?" : Yes : No
    200 : If : $$LastResult
    400 : Call : send mail report
    500 : Else
    700 : End If
     


  18. harsh sachdeva

    harsh sachdeva New Member


    @Amit Kamdar Sir how can we set the page size to be A4 in export function
     


  19. Amit Kamdar

    Amit Kamdar Administrator Staff Member


    For Export, there is no Page Size.

    Only if exporting to PDF or similar programs, it can be done and it is set at the OS's Printing properties.... not through Tally.
     


Share This Page