Qlik Community

Qlik NPrinting Discussions

Discussion Board for collaboration on Qlik NPrinting.

hopkinsc
Valued Contributor II

Nprinting to produce product labels

Hi all,

I have an NPrinting On Demand project that produces labels in a set format to a PDF (from an excel template) . i then print the PDF to my label printer which produces sticky labels for the products.

at the moment, if i need 10 labels of product 1 then i have to change the print qty to 10 when printing the PDF.

i have a QTY field in QV and i am wondering if it is possible to use this QTY field to produce a PDF with the correct QTY of labels already on it so i only have to click the print button once.

does anyone know if this is possible please?

i am using NP 17.4 (June 2017)

another question relating to the version..

NP16.x has the ability to configure the on demand button to pick up specific templates depending on selections made, is this possible in NP17 please?

any help would be appreciated.

1 Solution

Accepted Solutions
Support
Support

Re: Nprinting to produce product labels

Hi Chris,

You can achieve what you want using the PixelPerfect report type and some C# code.

Project attached.

Some notes:

DetailCountOnEmptyDataSource property that is of course not available for a data bound DetailReport band

  • The C# script in the BeforePrint event stores the value of the Units column and sets that to the DetailCountOnEmptyDataSource property

This way you can make any selection (or none) and trigger the On-demand report to generate the required labels

  • You will need to set the page size to custom and adjust as required

HTH - Daniel.

10 Replies
hopkinsc
Valued Contributor II

Re: Nprinting to produce product labels

Can anyone help with this please?

Re: Nprinting to produce product labels

Are those 10 labels all identical, or do they have a unique value on them. In the latter case it might be a matter of simply defining a Level and a page-filling area in your Excel to let NPrinting loop through your unique field values and create a page per label. That should work even if your data only contains 2 or 6 or 100 unique numbers.

I don't think you can make a template dynamically selectable on the Report level in the current version of NPrinting, but I'm not sure. What you can try is to integrate the content of different templates into a single one and add some template code to change the layout depending on QlikView fields and/or variables.

hopkinsc
Valued Contributor II

Re: Nprinting to produce product labels

Hi Peter, thanks for your reply

so basically if the customer order consists of:

ProductA x 10

ProductB x 4

ProductC x 1

the details of each product are the same.

so what i want is an output to include

10 labels of ProductA - all with the same details

4 labels of ProductB - all with the same details

1 label of ProductC

so i then click print once and i get 15 labels printed off from the label printer.

i have a QTY field in QV so i QV would know that the customer has ordered 10 of productA etc.

i dont think NPrinting can look at a QTY field and produce multiple labels based on that field but i just wanted to ask some experts

i was also wondering if i could maybe use a macro to do this, but from what i know, NP would run the macro in the template straight away before any data is fetched from QV??  or am i wrong? and then when it does the 2nd label the macro wouldnt run again to pick up the QTY and produce the correct amount of labels.

hopkinsc
Valued Contributor II

Re: Nprinting to produce product labels

Hi everyone, just wondered if there are any more suggestions on this?

sjw

ath

djk

Support
Support

Re: Nprinting to produce product labels

Hi Chris,

Sharing a sample QVW will help.

I am curious to know how you have achieved that in QlikView. As NPrinting essentially uses filters to emulate selections, I would first figure out (if you haven't already) how to achieve the following in QlikView (without involving NPrinting just yet):

1. There are n number of products. I assume n is not a fixed number and can potentially be quite large.

2. I gather that you want the user to select the quantity of labels to print for each product. If that is the case, there should be n number of variables, each to hold the quantity of labels to print for each product. Since n is not fixed, how have you done that? You mention

ProductA x 10

ProductB x 4

ProductC x 1

...for a total of 15 labels. Of course that number would change if the user wants a different product/qty combination.

I would suggest that if you can make selections in a QlikView document to populate a straight table with the data and number of rows required to generate the report, you should be able to use NPrinting On-demand to achieve what you want. https://help.qlik.com/en-US/nprinting/September2017/Content/On-Demand/Create-Report-On-Demand.htm

  • Create the report using the straight table as the source. Make sure the report is On-demand enabled
  • The user makes the appropriate selections on the QVW in the AccessPoint and generates the report using On-demand.

HTH - Daniel.

hopkinsc
Valued Contributor II

Re: Nprinting to produce product labels

Hi Daniel,

thanks for your reply.

so currently i have a QVW which holds sales order data, the user then selects a single order which then populates a straight table with the order details. this straight table then populates cells in an excel NP template (which is set up as a label). At the moment the QTY field isnt being used, even though its in the straight table in QV, so when the NP report is run, a single label per page is produced for each line item on the order. this means that if the user needs 10 of item 1 then they have to change the print dialogue to only print page 1 and change the print qty to 10. then they have to do the same for item 2 etc. obviously this can be time consuming if the order has 20+ items on it.

so i now need to use the QTY field to produce the correct QTY of labels per item so the user just has to click PRINT once.

I have changed this from using NP17.4 to NP 16 so that i can use an IF statement on the report button to pick up the correct label template based on the customer as some customers have different formats to others (there are 15 different label templates). i can't see a way of doing this in np17.

so i can now get a sample set up and attach the files later today if thats ok?

many thanks

Chris

hopkinsc
Valued Contributor II

Re: Nprinting to produce product labels

Hi Daniel,

files attached

thanks for your help

Support
Support

Re: Nprinting to produce product labels

Hi Chris,

You can achieve what you want using the PixelPerfect report type and some C# code.

Project attached.

Some notes:

DetailCountOnEmptyDataSource property that is of course not available for a data bound DetailReport band

  • The C# script in the BeforePrint event stores the value of the Units column and sets that to the DetailCountOnEmptyDataSource property

This way you can make any selection (or none) and trigger the On-demand report to generate the required labels

  • You will need to set the page size to custom and adjust as required

HTH - Daniel.

Employee
Employee

Re: Nprinting to produce product labels

Great, Great Great, Daniel!!!



Best Regards,
Ruggero
---------------------------------------------
When applicable please mark the appropriate replies as CORRECT. This will help community members and Qlik Employees know which discussions have already been addressed and have a possible known solution. Please mark threads with a LIKE if the provided solution is helpful to the problem, but does not necessarily solve the indicated problem. You can mark multiple threads with LIKEs if you feel additional info is useful to others.
Community Browser