Print Format "missing lines" - cause unknown

Hi All,

In the last week the workstation in our Despatch area is printing erratically to the label printer. Random lines from the print format are missing. Below is a photo of 4 prints each done one after the other of the same print format in ERPNext with no system changes at all. No changes were made to the output prior to this occurring either so I’m at a loss to explain it. I’ve tried checking printer margins, page setup, etc. The print preview shows fine with all lines included but then when you print it does this.

Any suggestions - CAN it be system related or is the printer malfunctioning???

Thanks.

Can you please share screenshot of print preview and print format.

Just a suggestion if you want to print multiple copies of same thing just save it as PDF and print.

1 Like

Yes I should have pasted the print format code:

> <font face="verdana">
> {%- if doc.customer == "McDonald Printing Group" or doc.customer == "Berlex" or doc.customer == "IPG Print" or doc.customer == "Breed Brand Management" -%}
>     <h4>Order No:&nbsp {{ doc.po_no }}</h4><br>
> {%- endif -%}
> <h2><b>
> {%- if doc.manual_contact -%}
>    {{ doc.manual_contact }}
> {%- else -%}
>    {%- if doc.contact_display==doc.customer_name -%}
>    {%- else -%}
>    {{ doc.contact_display }}
>    {%- endif -%}
> <br>
>    {{ doc.customer_name }}
> {%- endif -%}
> <br>
> {%- if doc.manual_address_1 -%}
>    {{ doc.manual_address_1.replace('\n', "<br/>") }}
> {%- else -%}
>    {{ doc.shipping_address }}
> {%- endif -%}
> {%- if doc.ship_by=="Pickup" -%}
> </b></h2><br><p>
> <small>{{ frappe.format_value((doc.base_grand_total or 0.0)- (doc.deposit or 0.0), doc.meta.get_field('base_grand_total'),doc) }}</small>
> {%- endif -%}

And the preview:

yes pdf would be better

@johnskywalker not sure what that means.

@KanchanChauhan saving as a PDF is not an option, this workstation is for despatch, we set the workflow_state on the SO then print a label or labels for shipping. The label is different every time and takes the address from the Sales Order information. I printed 4 like that to show the problem.

Given the preview is correct and PDF is also correct I guess it’s a printer problem but thought I’d check if anyone had ideas as I’m at a loss. Nothing has changed with the printer to cause it :confused:

Hi, do you have pdf button in your screen?

upper right, beside full page

Print preview is fine, may be your printer is acting strange.

I created a new print format and made it very basic:

<h4>Order No:&nbsp {{ doc.po_no }}</h4><br>
{{ doc.contact_display }} <br>
{{ doc.customer_name }} <br>
{{ doc.shipping_address }}

It prints reliably every time, no missing lines.

By the time I add my if/else clauses like so it has the problem. Can someone have a look and see if there’s a problem with my syntax that might be causing it? It can only be interaction between the printer and the if/else clauses that causes it given the code above works 100% every time?

<h4>Order No:&nbsp {{ doc.po_no }}</h4><br>
<h2><b>
{%- if doc.manual_contact -%}
   {{ doc.manual_contact }}
{%- else -%}
   {%- if doc.contact_display==doc.customer_name -%}
   {%- else -%}
   {{ doc.contact_display }}
   {%- endif -%}
<br>
   {{ doc.customer_name }}
{%- endif -%}
<br>
{%- if doc.manual_address_1 -%}
   {{ doc.manual_address_1.replace('\n', "<br/>") }}
{%- else -%}
   {{ doc.shipping_address }}
{%- endif -%}

Update, I can also print out of Firefox without any issue at all. So what does that tell us, LOL? Has to be something specific between the print format and how it’s rendered by Google Chrome? Next test is see if I can get a reliable print out of Google Chrome by using PDF rather than Print.