And I need to fire “Reset” command after the Report is printed to return Printer to “normal”, but it prints the XCT at the bottom instead of processing it:
[Exception Info 1]
Top-level Exception
Type: System.FormatException
Message: Input string was not in a correct format.
Source: mscorlib
Stack Trace: at System.Number.StringToNumber(String str, NumberStyles options, NumberBuffer& number, NumberFormatInfo info, Boolean parseDecimal)
at System.Number.ParseInt32(String s, NumberStyles style, NumberFormatInfo info)
at System.Convert.ToInt32(String value)
at Samba.Services.Implementations.PrinterModule.Tools.LinePrinter.<>c.<ExecCommand>b__37_0(String x) in C:\Users\emree\Documents\Github\SambaPOSPro\Samba.Services\Implementations\PrinterModule\Tools\LinePrinter.cs:line 404
at System.Linq.Enumerable.WhereSelectArrayIterator`2.MoveNext()
at System.Linq.Enumerable.Aggregate[TSource,TAccumulate](IEnumerable`1 source, TAccumulate seed, Func`3 func)
at Samba.Services.Implementations.PrinterModule.Tools.LinePrinter.ExecCommand(String command) in C:\Users\emree\Documents\Github\SambaPOSPro\Samba.Services\Implementations\PrinterModule\Tools\LinePrinter.cs:line 404
at Samba.Services.Implementations.PrinterModule.PrintJobs.SlipPrinterJob.SendToPrinter(LinePrinter linePrinter, ILineFormatter line, Printer printer) in C:\Users\emree\Documents\Github\SambaPOSPro\Samba.Services\Implementations\PrinterModule\PrintJobs\SlipPrinterJob.cs:line 76
at Samba.Services.Implementations.PrinterModule.PrintJobs.SlipPrinterJob.DoPrint(AppState appState, String[] lines) in C:\Users\emree\Documents\Github\SambaPOSPro\Samba.Services\Implementations\PrinterModule\PrintJobs\SlipPrinterJob.cs:line 23
at Samba.Services.Implementations.PrinterModule.PrintJobs.PrintJobCache.Print(AppState appState) in C:\Users\emree\Documents\Github\SambaPOSPro\Samba.Services\Implementations\PrinterModule\PrintJobs\PrintJobFactory.cs:line 77
at Samba.Services.Implementations.PrinterModule.PrintJobExecutor.InternalExecutePrintJob(AppState appState, PrintJob printJob, Int32 copies, IDictionary`2 parameters) in C:\Users\emree\Documents\Github\SambaPOSPro\Samba.Services\Implementations\PrinterModule\PrintJobExecutor.cs:line 98
at Samba.Services.Implementations.PrinterModule.PrintJobExecutor.<>c__DisplayClass20_0.<Execute>b__0() in C:\Users\emree\Documents\Github\SambaPOSPro\Samba.Services\Implementations\PrinterModule\PrintJobExecutor.cs:line 83
at Samba.Services.Implementations.PrinterModule.AsyncPrintTask.InternalExec(Action action, ILogService logService) in C:\Users\emree\Documents\Github\SambaPOSPro\Samba.Services\Implementations\PrinterModule\AsyncPrintTask.cs:line 32
But it does not evaluate the expression when it is in a regular Template and you pass $KEY=value parameters in the Execute Print Job Action. The error is thrown.
I did not try an Expression in a Report Template since it does not (yet) support key/value parameters. Even so it will execute XCT commands fine when they are at the very top of the template. But it will not execute XCT if the commands are anywhere else, like at the bottom of the Report.
To test expressions, I can try something like this at the top of the Report for now:
Top-level Exception
Type: System.FormatException
Message: Input string was not in a correct format.
Source: mscorlib
Stack Trace: at System.Number.StringToNumber(String str, NumberStyles options, NumberBuffer& number, NumberFormatInfo info, Boolean parseDecimal)
at System.Number.ParseInt32(String s, NumberStyles style, NumberFormatInfo info)
at System.Convert.ToInt32(String value)
at Samba.Services.Implementations.PrinterModule.Tools.LinePrinter.<>c.<ExecCommand>b__37_0(String x) in C:\Users\emree\Documents\Github\SambaPOSPro\Samba.Services\Implementations\PrinterModule\Tools\LinePrinter.cs:line 404
at System.Linq.Enumerable.WhereSelectArrayIterator`2.MoveNext()
at System.Linq.Enumerable.Aggregate[TSource,TAccumulate](IEnumerable`1 source, TAccumulate seed, Func`3 func)
at Samba.Services.Implementations.PrinterModule.Tools.LinePrinter.ExecCommand(String command) in C:\Users\emree\Documents\Github\SambaPOSPro\Samba.Services\Implementations\PrinterModule\Tools\LinePrinter.cs:line 404
at Samba.Services.Implementations.PrinterModule.PrintJobs.SlipPrinterJob.SendToPrinter(LinePrinter linePrinter, ILineFormatter line, Printer printer) in C:\Users\emree\Documents\Github\SambaPOSPro\Samba.Services\Implementations\PrinterModule\PrintJobs\SlipPrinterJob.cs:line 76
at Samba.Services.Implementations.PrinterModule.PrintJobs.SlipPrinterJob.DoPrint(AppState appState, String[] lines) in C:\Users\emree\Documents\Github\SambaPOSPro\Samba.Services\Implementations\PrinterModule\PrintJobs\SlipPrinterJob.cs:line 23
at Samba.Services.Implementations.PrinterModule.PrintJobs.SlipPrinterJob.DoPrint(AppState appState, FlowDocument document) in C:\Users\emree\Documents\Github\SambaPOSPro\Samba.Services\Implementations\PrinterModule\PrintJobs\SlipPrinterJob.cs:line 39
at Samba.Services.Implementations.PrinterModule.PrintJobs.PrintJobCache.Print(AppState appState) in C:\Users\emree\Documents\Github\SambaPOSPro\Samba.Services\Implementations\PrinterModule\PrintJobs\PrintJobFactory.cs:line 75
at Samba.Services.Implementations.PrinterModule.PrintJobs.PrintJobFactory.Print(AppState appState) in C:\Users\emree\Documents\Github\SambaPOSPro\Samba.Services\Implementations\PrinterModule\PrintJobs\PrintJobFactory.cs:line 26
at Samba.Services.Implementations.PrinterModule.ReportPrinter.<>c__DisplayClass11_0.<Print>b__0() in C:\Users\emree\Documents\Github\SambaPOSPro\Samba.Services\Implementations\PrinterModule\ReportPrinter.cs:line 54
at Samba.Services.Implementations.PrinterModule.AsyncPrintTask.InternalExec(Action action, ILogService logService) in C:\Users\emree\Documents\Github\SambaPOSPro\Samba.Services\Implementations\PrinterModule\AsyncPrintTask.cs:line 32