Print Report rotated by 90 degrees and/or using smaller Font

Tried this, but it is not processing XCT commands - it just prints them.

[Employee Earnings Summary $2:2,1, 1, 1, 1, 1, 1]
<XCT>27,77,1,49
>>Period| |Hours|REG|OT|HOL|EARNED
>@@TC_EmployeeEarnings1530:$1,$2,$3,$4,$5
>>Month| |Hours|REG|OT|HOL|EARNED
>@@TC_EmployeeEarningsTTL:$1,$2,$3,$4,$5

[Employee Payments $2:1.5,4, 1.4]
>Date|Description|Paid
@@EmployeePayments:$1,$2,$3,$4,$5
>>TOTALS| |
>@@EmployeePaymentsTTL:$1,$2,$3,$4,$5
 
 
 
__________________________________________
Firma de |$2|{DATE:yyyy-MM-dd}
<XCT>27,64

This is the Preview, but the Print looks exactly the same:

Did ESC/POS printer printed the XCT tag? :open_mouth: Are you sure printer type selected as ESC/POS printer?

Maybe instead of adding it inside report tables you can try adding commands to the top of the template. Dumping it to notepad may give better idea.

Yes, the Report Printer is ESC/POS:

Hmm OK. Sorry for that but did you see my edit?

This worked for the most part in that most of the content is “reduced”, but the Report Title information is not reduced:

<XCT>27,77,1,49
[Employee Earnings Summary $2:2,1, 1, 1, 1, 1, 1]
>>Period| |Hours|REG|OT|HOL|EARNED
>@@TC_EmployeeEarnings1530:$1,$2,$3,$4,$5
>>Month| |Hours|REG|OT|HOL|EARNED
>@@TC_EmployeeEarningsTTL:$1,$2,$3,$4,$5

[Employee Payments $2:1.5,4, 1.4]
>Date|Description|Paid
@@EmployeePayments:$1,$2,$3,$4,$5
>>TOTALS| |
>@@EmployeePaymentsTTL:$1,$2,$3,$4,$5
 
 
 
__________________________________________
Firma de |$2|{DATE:yyyy-MM-dd}
<XCT>27,64


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:

Tried the expression method again in the Template and passed parameter, but error still appears:

##Template:

<XCT>27,33,[=$font=='B' ? 1 : 0]


##Rule


##ERROR Report:

[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

Can you execute it to notepad printer?

Yes, and the TXT file contains this:

27,33,[='B'=='B' ? '1' : '0']

EDIT: Hold on … that worked perfectly! Sorry does not work. No error messages, but the command is not executed …

Strange when I put this on top of report template…

It seems to evaluate fine…

… and evaluates while printing too.

also seems to captured by esc/pos printer.

I’ve just tested and it also works fine when I trigger it from Print Report action.

What is the difference for you?

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:

<XCT>27,33,[=$6=='B' ? 1 : 0]


… and pass in parameter #6 with Print Report Action …

#It works!


##Another Report Test

Printing from Report Explorer does not work… same error:

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

This one is probably different. Seems like happening because of the trailing comma.

Well, maybe, but it is not evaluating the expression, which is quite clear:

<XCT>27,33,[=$6=='B' ? 1 : 0]

So if $6 is null or blank or whatever, as it would be from the Report Explorer, the output should be:

<XCT>27,33,0

But you can see that the output is instead:

<XCT>27,33,

If I change the expression to include quotes:

<XCT>27,33,[='$6'=='B' ? '1' : '0']

It is evaluated properly as:

<XCT>27,33,0

And the Print works! But of course it is using regular FontA instead of condensed FontB, but that is expected.