Facing issue while exporting the report from Tally using command line

Viewed 13

We want some functionality where we can export the report using the command line so that we can execute that command through some batch file and export reports on a daily schedule time.

Issue:

For this ,we are trying some code snippet from Tally developer "Help --> TDL Sample"(this is complete path of sample code C:\Program Files\TallyPrimeDeveloper\Samples\Whats New\Rel 3.x\Rel 3.0\Programmable Configurations\Export Report Trial Balance.txt).

The following code sample works properly on button click and we are successfully exported the report in our folder

"""[Button: TSPL Smp Export PC]

Key     : Ctrl + E
Action  : Call  : TSPL Smp PC Export Report
Title   : "Export Report"

;; Function Definition begins

[Function: TSPL Smp PC Export Report]

Local Formula       : SysDate           : $$SysInfo:SystemDate

00  : SET           : SVExportLocation  : "."
10  : SET           : SVExportFormat    : $$SysName:PDF
20  : SET           : SVPrintFileName   : "List of Ledgers as onShri_1234 " + $$String:@SysDate + ".PDF"
30  : SET           : SVPrintFileName   : $$MakeExportName:##SVPrintFileName:##SVExportFormat
40  : EXPORT REPORT : .                 : TRUE
50  : Msg Box   : "TestMsg2"    :"We need to download this report through command line" """

But we are facing issue when we are trying to call this same function through command line
Command line is : "C:\Program Files\TallyPrime\tally.exe" /Load:10000 /Action:Call:TSPLSmpPCExportReport .

As per our observations and debugging, the above function gets successfully called through the command line because when I am executing it through the command line,I am getting a "TestMsg2" popup but the file is not getting exported. It seems there is some issue only in file export through the command line, not in function calling through the command line.

1 Answers

I have a solution that works, but without TDL and uses C# or Python

Using C# you can create console app, and you can use that in command line using Python, you can create script and run from command line

Refer this video for python

Related