Printing Labels with databases via Nicewatch command files

Label printing integration (NiceWatch middleware and ActiveX programming interface)

Moderator: NiceLabel Support Team

Printing Labels with databases via Nicewatch command files

Postby ssheppard » Thu May 06, 2010 9:34 am

Is it possible to print a specific label/record from a Nicewatch Pro label which is connected to an Access database table , via a Nicewatch command file?

If so, how do I pick out the specific record I want to print?
ssheppard
Veteran
Veteran
 
Posts: 52
Joined: Wed Feb 17, 2010 6:12 pm

Re: Printing Labels with databases via Nicewatch command fil

Postby Saso » Thu May 06, 2010 9:51 am

You can do it like this:
  1. Connect a database to the label template.
  2. Define a filter to this connection.
    See Date -> Database -> Edit -> Filter tab.
  3. When you print the label from NiceLabel Pro, you will be prompted to provide the information for the product ID. NiceLabel will open the database and find the record matching the rule: entered ID equals ID from a database.
  4. See label template example:
    c:\Program Files\EuroPlus\NiceLabel 5\Samples\Labels\Database Filter.lbl
  5. Once you have this filter working from NiceLabel Pro, just move the printing scenario to NiceWatch.
  6. NiceWatch must get the product ID somehow. There are several types of incoming data available. Usually NiceWatch gets data in a text file. Once the text file changes, NiceWatch can get product ID information from the file and send it to the label.
    The trigger text file might have just the ID included, like this:
    Code: Select all
    2
  7. You define a filter in NiceWatch to get this value out of the text file and send it to label (Filter tab).
  8. The label with the correct data prints out.

For NiceWatch samples see the sample configuration file:
c:\Program Files\EuroPlus\NiceLabel 5\Samples\Labels\sample.mis

From your post it is not clear if you want to use NiceLabel Pro's command line options or NiceWatch.
I presumed you want NiceWatch...

If you want to use NiceLabel Pro and its command-line options, see the possibilities with the JOB files.
  1. See NiceLabel Pro's help topic Integration and Connectivity -> NiceCommands.
  2. See sample JOB files in the folder:
    c:\Program Files (x86)\EuroPlus\NiceLabel 5\Samples\Labels
  3. If you follow a label sample from Database Filter.lbl, a simple JOB file to print label with Person ID "1" might look like:
    Code: Select all
    LABEL c:\Program Files\EuroPlus\NiceLabel 5\Samples\Labels\Database Filter.lbl
    SET PersonID = 1
    PRINT 1

    Save this contents as file MYJOBFILE.JOB.
  4. You would run the command file like this:
    Code: Select all
    c:\Program Files\EuroPlus\NiceLabel 5\bin\nlabel5.exe MYJOBFILE.JOB
Saso Fleiser
Senior Technical Product Specialist
User avatar
Saso
NiceLabel
NiceLabel
 
Posts: 2318
Joined: Mon Sep 04, 2006 8:09 am

Re: Printing Labels with databases via Nicewatch command fil

Postby ssheppard » Thu May 06, 2010 1:27 pm

Thanks for the answer, maybe I can explain my problem in more detail.

I designed a label with 2 Text boxes, each with a variable attached and printed it with the following method.
1) A VB front end gets the data from a record in a database table and updates the JOB file e.g.
SET VariableText1 = "Data"
SET VariableText2 = "Data"
2) Nicewatch prints the label.
This works perfectly.

Since there are 20 different records in the database table, I decided to attach the database table to the lbl file to check uniformity of formating across all labels. Therefore the original variables became redundant .

I can still use the above method to print label by updating the JOB file as follows:
SET LabelsTable.VariableText1 = "Data"
SET LabelsTable.VariableText2 = "Data"

But I would prefer a method where I only have to specify the value for one key feild in the JOB file (e.g. SET LabelsTable.VariableText1 = "Data") and the rest of the database record is printed automatically by the lbl file.
ssheppard
Veteran
Veteran
 
Posts: 52
Joined: Wed Feb 17, 2010 6:12 pm

Re: Printing Labels with databases via Nicewatch command fil

Postby Saso » Thu May 06, 2010 1:55 pm

OK, understood!
Then the solution is in the first part of my previous post.

You must define a filter in the current database connection in the label.
The only variable you have to set from the JOB file is this filter variable.

See how the following label sample is done:
c:\Program Files\EuroPlus\NiceLabel 5\Samples\Labels\Database Filter.lbl

You need something similar in your label.
Saso Fleiser
Senior Technical Product Specialist
User avatar
Saso
NiceLabel
NiceLabel
 
Posts: 2318
Joined: Mon Sep 04, 2006 8:09 am

Re: Printing Labels with databases via Nicewatch command fil

Postby ssheppard » Thu May 06, 2010 4:31 pm

Thanks, got it now.

I noticed on the sample database, in the label design area, the yellow area which represents the size of the printer page, disappears when I select a pdf printer. This doesn't happen when I select the same pdf printer with the label I designed, do you know if there is a way to control this?
ssheppard
Veteran
Veteran
 
Posts: 52
Joined: Wed Feb 17, 2010 6:12 pm

Re: Printing Labels with databases via Nicewatch command fil

Postby ssheppard » Thu May 06, 2010 4:38 pm

Hi, please ignore the last post, I thinks its simly to do with printer drivers, thanks.
ssheppard
Veteran
Veteran
 
Posts: 52
Joined: Wed Feb 17, 2010 6:12 pm


Return to Label Printing Integration & Programming

Who is online

Users browsing this forum: No registered users and 4 guests