Manual print job: '[LAYOUT]' gets printed

We are often asked for specific bits of information

  • Map to a car park
  • Map to an ATM
  • Our business legal details
  • Etc… etc…

I have set-up everything so that I can print these using a single button from the navigation screen, but for some reason comments and the [LAYOUT] are being printed and not stripped away. The preview for the print template looks correct, but the ntoepad demo printer and the real printer all print the text which should be hidden.

You can see the problem below…

Print template:

Print job:

Action:

I have tried with changing the options of print ticket and Update Ticket Number, but no matter what I do it always has this problem.

Any sugegstions?

What is the Printer Type set to in SambaPOS?

It can make a difference as to the way Tags are interpreted, and depending on that setting, some things are not supported at all.

This is how I have it set. General tickets print fine. It’s just these manually triggered ones…

I just noticed the guy with the {USER NAME} issue in the other thread. I spotted that when you asked him to add [LAYOUT] to the top of his template, the word [LAYOUT] was also printed. Could this be related?

How you execute print job, inside ticket or automation button on entity screen?

A rule triggered by an Automation command button on the main navigation screen (using cutom navigation)

Maybe [LAY OUT] section was meant for ticket. So no ticket, LAY OUT was not valid.

I tried that, but the comments still appear.

I know I could just remove the comments, but I was just wondering if I was doing anything wrong and particularly why the preview looks correct, but the print (physical or notepad) shows the comments.

You may try to execute it in ticket.
SO, open new ticket and execute it without any item.

Just tried that as you wrote it!

Printing as a ticket, the comments are removed.

@emre - Any idea why triggering the print job when it’s not a ticket causes this problem?

Yes, it is strange. I think @sukasem is correct, but still…

Removing [LAYOUT] does not fix the problem - it does not print that, but the comments are still printed, which is strange.

In the Account Statement Tutorial we use an Action called Print Entity and it does not exhibit this problem …

And we have this Template:

[ENTITY]
-- a comment
<T>ACCOUNT STATEMENT
<J00>Customer: {ENTITY NAME}|Account: {ACCOUNT NAME}
<J00>Tx Since: {SETTING:AS Date Filter Beg}|Balance: {ENTITY BALANCE}
<F>=
-- another comment
<J00>Date| TID| TNo| Description| Amount| Balance
<F>-
{REPORT SQL DETAILS:@@GetStatement:
F.TxDate.desc,F.TicketId,F.TicketNo,F.Description,F.Amount,F.Balance::
<J00>{0}| {1}| {2}| {3}| {4}| {5}
}
<F>=

A Printer for testing:

And a Print Job:

The output is fine - the comment lines are not printed:

I created this simple test…

Template:

[LAYOUT]
-- this is a comment
<W00:12,30>First Line|1
<W00:12,30>Second Line|2
-- another comment
<W00:12,30>Third Line|3
<W00:12,30>Fourth Line|4

Preview is kind of good, but not totally correct…

Printer:

Print Job:

Action:

Rule:

Output - notice the justification is incorrect and it is printing thiing that it should not:

Your test is interesting - For me, the preview of the columns is corrent.

Following your suggestion, I changed [LAYOUT] to [ENTITY] and change the action to Print Entity and it does seem to work well for what I need.

Seems strange that “Execute Print Job” doesn’t work in quite the same way…

Glad that you got it to work in some way. I can’t get it to print at all when I use Print Entity Action… maybe because I don’t have an Entity selected?

I just entered a random number in as the Entity and then it printed

Cool. I did a Load Entity Action (and specifed an existing Entity), just before Print Entity.

I see the justification is still incorrect, and I added the {USER NAME} Tag as in the other Topic, and it will not Print …

Ticket-specific Tags probably do not work unless a Ticket is loaded, but still can’t figure why the alignment is not obeyed:

Now that I have ENTITY instead of LAYOUT nothing shows up at all in the preview.

There is definitely something werid going on here.

@QMcKay - Should this be changed to a V5 Issue?

Nothing shows up in my preview either when having [ENTITY] but I figure this is normal since the Template is unaware of an Entity being loaded.

As far as the Execute Print Job Action doing weird things, maybe it is a bug… I just can’t imagine that no one has ever seen it before, unless it was a bug introduced in a recent version.

Execute Print Job basically prints a ticket so needs a loaded ticket. To allow printing entity related things without being required to load a ticket I implemented Print Entity to allow you to load an entity and use Entity related Tags. It uses [ENTITY] as the base layout tag.

We also have Print Report or Print Account Screen actions for other non-ticket printing tasks.

Print Preview allows testing test ticket layouts so it loads “last created” ticket and prints it.

@emre, what we’re looking for is to be able to arbitrarily print a “static” document (template) without loading anything, but still be allowed to use common formatting mechanisms like <L> <T> <W> etc. and at the same time not print commented lines.