CONCATENATE ON THERMAL PRINTING

Hello everyone,

Currently, I'm making some basic apps that function as a receipt and can print in a thermal printer.

I am able to print it using concatenate but hit some problems in terms of printing where the blank rows were using space during an actual print which is a waste of paper.

here are my simple codes:

concatenate(
"RECEIPT #: ",([RECEIPT#]),"
",([DATE]),"
",([NAME]),"
",([ZONE]),"
",([LOCATION]),"
","# OF ITEMS: ",([NUMBER OF ITEMS]),"
","WEIGHT: ",([WEIGHT]),"
",([DISPATCH]),"
","CHARGES: ", ([CHARGES]),"
","TOTAL: ", ([TOTAL]),"
",([PRICE 1]),"
",([PRICE 2]),"
",([PRICE 3]),"
",([PRICE 4]),"
",([PRICE 5]),"
",([PRICE 6]))

Now if all Prices rows from Prices 5-6 or more are not filled-in (meaning it's blank) and it is, but that blank uses space during printing.

Is there any other way to avoid this?

Any help is highly appreciated

Solved Solved
1 8 1,083
2 ACCEPTED SOLUTIONS

Steve
Platinum 4
Platinum 4
SUBSTITUTE(
  CONCATENATE(
    LIST(
      ("RECEIPT #: " & [RECEIPT#]),
      ("" & [DATE]),
      ("" & [NAME]),
      ("" & [ZONE]),
      ("" & [LOCATION]),
      ("# OF ITEMS: " & [NUMBER OF ITEMS]),
      ("WEIGHT: " & [WEIGHT]),
      ("" & [DISPATCH]),
      ("CHARGES: " & [CHARGES]),
      ("TOTAL: " & [TOTAL]),
      ("" & [PRICE 1]),
      ("" & [PRICE 2]),
      ("" & [PRICE 3]),
      ("" & [PRICE 4]),
      ("" & [PRICE 5]),
      ("" & [PRICE 6])
    )
    - LIST("")
  ),
  " , ",
  "
"
)

Note carefully the lack of indentation in the third argument of SUBSTITUTE().

View solution in original post

8 REPLIES 8

You should be able to exclude rows with something like this

IF(ISBLANK([PRICE 5]),"",",([PRICE 5]),")

Apology for the delayed reply, I was trying it but it's not the one am looking for because it still uses space or the result is different.

Appreciated your reply to my post.conconate 2.jpgconconate.jpg

OK that was my mistake, the newlines inside the quotations make this difficult to read, try the following:

concatenate(
"RECEIPT #: ",([RECEIPT#]),"
",([DATE]),"
",([NAME]),"
",([ZONE]),"
",([LOCATION]),"
","# OF ITEMS: ",([NUMBER OF ITEMS]),"
","WEIGHT: ",([WEIGHT]),"
",([DISPATCH]),"
","CHARGES: ", ([CHARGES]),"
","TOTAL: ", ([TOTAL]),"
",([PRICE 1]),"
",([PRICE 2]),"
",([PRICE 3]),"
",([PRICE 4]),IF(ISBLANK([PRICE 5],"","
",([PRICE 5])),IF(ISBLANK([PRICE 6],"","
",([PRICE 6])),IF(ISBLANK([PRICE 7],"","
",([PRICE 7])),IF(ISBLANK([PRICE 8],"","
",([PRICE 8])),IF(ISBLANK([PRICE 9],"","
",([PRICE 9])))

Steve
Platinum 4
Platinum 4
SUBSTITUTE(
  CONCATENATE(
    LIST(
      ("RECEIPT #: " & [RECEIPT#]),
      ("" & [DATE]),
      ("" & [NAME]),
      ("" & [ZONE]),
      ("" & [LOCATION]),
      ("# OF ITEMS: " & [NUMBER OF ITEMS]),
      ("WEIGHT: " & [WEIGHT]),
      ("" & [DISPATCH]),
      ("CHARGES: " & [CHARGES]),
      ("TOTAL: " & [TOTAL]),
      ("" & [PRICE 1]),
      ("" & [PRICE 2]),
      ("" & [PRICE 3]),
      ("" & [PRICE 4]),
      ("" & [PRICE 5]),
      ("" & [PRICE 6])
    )
    - LIST("")
  ),
  " , ",
  "
"
)

Note carefully the lack of indentation in the third argument of SUBSTITUTE().

Hi friend!

Can you share the way to print once you have ready the body to print?

Print each label directly to a supported thermal label printer. Excellent for performance and fine-tuning thermal printing.

Hi @Bael Bael, i'm building a similar app, and i want to print a receipt by smartphone, can you tell me how is it possible? i didn't found any tutorial about that.

Top Labels in this Space