Verify PRN data file sent to printer printed correctly

Software technical issues not related to any of the other categories

Moderators: Georges, milos, NiceLabel Support Team

Post Reply
vijaya raghava
Enthusiast
Posts: 8
Joined: Wed Mar 15, 2017 7:51 am

Verify PRN data file sent to printer printed correctly

Post by vijaya raghava » Thu Jun 29, 2017 7:34 pm

Data is sent to printer as PRN file. The data that is sent to printer was created from Automation DB Trigger, Action Redirect Printing to File. At the time the Automation DB Trigger is creating the PRN we can see the Windows Queue displaying pages / pages printed.

We need to be able to track the progress of our print jobs in PRN files , which were created from the Automation DB Trigger

reason: once the data is sent to the printer as PRN file. the Automation manager is updating in database as its printed but in some cases because of network issues the data is getting lost and it is not reaching the printer. So some records are actually not getting printed.

we are verifying the printer status before sending the PRN file. The loss is happening if network face issues after sending the file.

Any ideas would be appreciated.

User avatar
Saso
NiceLabel
NiceLabel
Posts: 2933
Joined: Mon Sep 04, 2006 8:09 am
Contact:

Re: Verify PRN data file sent to printer printed correctly

Post by Saso » Tue Jul 04, 2017 9:39 am

In NiceLabel Automation, printing process is asynchronous job. You can capture errors while the software tries to create a print job. But once you have print job in Windows Spooler, Automation does not track it anymore and does not know about its final status. You can only use Automation to track the status about “I successfully created a print job in Windows Spooler”.

There is another NiceLabel service that actually tracks print job and knows its final state (paused in Spooler, deleted, in error, sent to printer etc.) However, this service runs in parallel with Automation Service with no communication between them. We have already collected ideas for Automation to be aware of the final print job status, but for now they are on the “wish-list”.

There could be a way for you to track the print job status.
s1.png
s1.png (78.33 KiB) Viewed 1616 times
When you install NiceLabel Control Center (the management component in NiceLabel LMS products), it will collect information about print history from all NiceLabel clients, including your NiceLabel Automation deployment. That “other service” that tracks print job status will provide information about it. Control Center stores the information into SQL database.

First, Control Center receives data from Automation about the print job content, such as label name, list of variables and their values, printer name, quantity, etc. Then, subsequently the status information is sent to Control Center: “the print job is in the spooler”, “we are sending print job to printer”, “we have sent print job to printer”, etc. Control Center displays this live information in History tab for each print event.

You can open a database connection to the Control Center’s database and look up the current status information from it. You would need to investigate a bit how tables in the database are connected together, but that’s not too difficult.

The problem is, how to find your print job in the log database in the first place, so you can look up its current status. For these purposes, the Print Label action includes the “Metadata” field. This is data that does not print on the label, but can be used to link a specific print job with some identification. This can help you find your job in the log database. Once you find it, you can extract its current status.
s2.png
s2.png (41.72 KiB) Viewed 1616 times
I hope this helps understand what you can do.
Saso Fleiser
Senior Technical Product Specialist

vijaya raghava
Enthusiast
Posts: 8
Joined: Wed Mar 15, 2017 7:51 am

Re: Verify PRN data file sent to printer printed correctly

Post by vijaya raghava » Wed Jul 05, 2017 9:10 pm

Thanks Saso.

We are not able to find the metadata field in print label action. we are using V6. Please tell us which version NL you are using.
Attachments
PrintLabel.PNG
PrintLabel.PNG (129.88 KiB) Viewed 1606 times

vijaya raghava
Enthusiast
Posts: 8
Joined: Wed Mar 15, 2017 7:51 am

Re: Verify PRN data file sent to printer printed correctly

Post by vijaya raghava » Thu Jul 06, 2017 12:23 am

This is a part of what we captured in the TRACE mode automation. Do we have any commands which when executed through automation generates the same results as highlighted. As we can see the value gets incremented for every quantity it prints. we can track the data printed using it.
Attachments
tracemode.PNG
tracemode.PNG (109.61 KiB) Viewed 1604 times

User avatar
Saso
NiceLabel
NiceLabel
Posts: 2933
Joined: Mon Sep 04, 2006 8:09 am
Contact:

Re: Verify PRN data file sent to printer printed correctly

Post by Saso » Thu Jul 06, 2017 8:24 am

The metadata field in Print Label action is available on NiceLabel 2017 platform from the 2017.1 update in December 2016.

No, sorry, the data that you see in the tracing log are not exposed in any way to the user space. :?
The trigger itself can only be aware of the last status of the print action: success (print stream is in a Windows Spooler) or failure (there was an error creating print stream), but not about the details inside the print process.

Trace file is a detailed log of executions in the print process and meant to be used for debugging / troubleshooting.
Saso Fleiser
Senior Technical Product Specialist

dos_apples
Newcomer
Posts: 1
Joined: Mon Oct 17, 2016 9:55 pm
Location: DFW TEXAS

Re: Verify PRN data file sent to printer printed correctly

Post by dos_apples » Thu Jul 06, 2017 2:05 pm

Hello Saso thanks for the input and great information in this Forum. The Tracing showed Vijay that the DEVMODE logic is called while printing the labels with the “Print Label” action. The “Pages” and “PagesPrinted” attributes have values. By using the HTTP request to lblservices he could add in logic based on those values to assist his users that are requesting these labels. This logic is needed when a job doesn’t end as expected. When the “Send data to printer” action is used both “Pages” and “PagesPrinted” attributes do not have CORRECT values. He stated earlier that the file/data being sent to printer was created in earlier step using the “Redirect Printing to File” action. Could the “Set Print Parameter” action be called before and after the “Send Data to Printer” action to give him the DEVMODE option to include the values needed for both attributes “Pages” and “PagesPrinted”? If so would you be able to provide him with the proper commands to accomplish this task or is there a more direct approach to getting him the “Pages” and “PagesPrinted” values?
Output captured from HTTP request 1st with “Print Label”, 2nd with “Send data to Printer”

<NS2:TPQPrintJob id="7" xsi:type="NS2:TPQPrintJob">
<OEM xsi:type="xsd:int">-1</OEM>
<Product xsi:type="xsd:int">-1</Product>
<ID xsi:type="xsd:int">5</ID>
<Name xsi:type="xsd:string">LABEL</Name>
<Pages xsi:type="xsd:int">6</Pages>
<PagesPrinted xsi:type="xsd:int">0</PagesPrinted>
<Position xsi:type="xsd:int">4</Position>
<PrinterName xsi:type="xsd:string">AVERY</PrinterName>
<Priority xsi:type="NS2:TPQPrintJobPriority">pjpLow</Priority>
<Quantity xsi:type="xsd:int">0</Quantity>
<Status xsi:type="xsd:int">4096</Status>
<Owner xsi:type="xsd:string">NiceLBL</Owner>
<Submitted xsi:type="xsd:dateTime">2017-07-06T06:16:16.000-05:00</Submitted>
</NS2:TPQPrintJob>

<NS2:TPQPrintJob id="12" xsi:type="NS2:TPQPrintJob">
<OEM xsi:type="xsd:int">-1</OEM>
<Product xsi:type="xsd:int">-1</Product>
<ID xsi:type="xsd:int">10</ID>
<Name xsi:type="xsd:string">data</Name>
<Pages xsi:type="xsd:int">1</Pages>
<PagesPrinted xsi:type="xsd:int">0</PagesPrinted>
<Position xsi:type="xsd:int">9</Position>
<PrinterName xsi:type="xsd:string">AVERY</PrinterName>
<Priority xsi:type="NS2:TPQPrintJobPriority">pjpLow</Priority>
<Quantity xsi:type="xsd:int">0</Quantity>
<Status xsi:type="xsd:int">4096</Status>
<Owner xsi:type="xsd:string">NiceLBL</Owner>
<Submitted xsi:type="xsd:dateTime">2017-07-06T06:21:09.000-05:00</Submitted>
</NS2:TPQPrintJob>

Post Reply