Printed Labels

Previous  Top  Next


Configuration > Printed Labels

CISPro Global prints labels for a variety of uses: barcode identity labels for containers, hazard labels for containers, sample and retain labels. To provide flexibility, the system can be configured to provide the user with a list of labels to choose from for any of these purposes. In addition, different Workunits can be configured to use different sets of labels.

Labels consist of two required parts: a SQL Query, and a Printer Template. More information on constructing these parts will be provided at the end of this topic. Assuming that the SQL Query and Printer Template are already available, here is how to configure a Printed Label in CISPro Global:

To Configure a Printed Label

1.Log in as a global admin (a user with a role which has All System Config Permission)
2.Click the System Configuration link
3.Click the Printed Labels link

Creating a new Printed Label

1.Click on the Printed Label link at the top of the screen to display a pull-down menu
2.Click New Printed Label
3.Enter a Label Description (required)
4.Select the Used For type
5.Check Prompt for Label Text if necessary
6.Enter the SQL Query, and Printer Template
7.Enter any Params
8.Click Save

Editing an existing Printed Label

1.Click on the Printed Label name you wish to edit from the list at the left edge of the screen
2.Edit the field
3.Click Save

Deleting a Printed Label

1.Click on the Printed Label name you wish to delete from the list at the left edge of the screen
2.Click on the Printed Label link at the top of the screen to display a pull-down menu
3.Click Delete This Printed Label
4.Click Yes at the Confirmation prompt

 

config_printlabelsLabelQueryAndTemplate1

Configuring Work Unit Label Access

In some cases certain labels may differ by Work Unit. CISPro Global makes this easy by requiring that each label be configured for Work Units. Only Work Units which have been granted access to a label will be able to use it. Therefore, it is possible to have a large menu of label choices, but only a few are used by each Work Unit.

To Configure Work Unit Label Access

1.Select the label to configure by clicking its name in the list
2.Click the Work Unit Label Access link
3.Select a Work Unit and click the Add button

To Remove Work Unit access to a Label

1.Select the Work Unit by clicking its name in the list
2.Click the Remove Selected button

Label Configuration Options

Users can choose from several pre-configured or custom labels. The Used For indicates which labels to use when a particular operation is performed by the user. Here is a list of the label types and what field value is provided for the query when using each type:

Used For

Query Filtered To

Description

Basic Container Receipt

containers.containerid

Used to print basic receipt container labels and also to reprint container labels from Container Info page.

GMP Container Receipt*

containers.containerid

Used to print GMP receipt container labels and also to reprint container labels from Container Info page.

Dispense Basic

(no container) Label

dispensed.dispenseid

Print a receptacle (not tracked/barcoded) label for material dispensed from a basic container.

Dispense GMP

(no container) Label*

dispensed.dispenseid

Print a receptacle (not tracked/barcoded) label for material dispensed from a GMP container.

Sample Label*

samples.sampleid

Print sample bottle labels (barcodes must begin with S).

Retain Label*

samples.sampleid

Print retain labels (barcodes must begin with R).

Material Hazard Label

materials.materialid

Prints just the hazard info for a material, not specific to a container (no barcode).

Location Label

locations.locationid

Location barcodes must begin with LS. These are for use with handheld data collection devices.

User Label

users.userid

User labels print the userid for use with the Videx.

Label Types (Asterisk* = Material Qualification Module only)

Constructing SQL Queries

Each Label Type (Used For) requires a certain filtering value. When the user prints a label for an operation, the system will select the appropriate Used For label and provide the current filter value to query for that label.

Example: If the user reprints a label for a container, then the query will be provided with the containers.containerid value for the container the user is viewing. In that case, the query should look something like this:

select * from containers where containerid={containerid}

 

The key to SQL Queries for labels is in making sure that the query contains the appropriate field name within curly braces: {containerid}.  If the user were trying to print a User Label, then the query would look something like this:

select * from users where userid={userid}

 

It doesn't matter how complex the query is as long as the appropriate field name within curly braces is provided as part of the WHERE clause.

Using Printer Templates

CISPro Global can support any label printer as long as the printer has a way to accept text commands to describe a label. ChemSW has successfully used printers from Eltron, Zebra and Intermec for printing labels because each of these brands provides a "printer language" that is based on text commands. Here is how it works:

When the user prints a label, CISPro Global runs the query for that label, and then replaces the "tags" in the Printer Template with the results from the query. So if a tag matches a field name in the query, the data goes into the tag space in the template. If there is no matching field, then the tag is replaced with blank text.

There are also some "special functions" which can be used as tags to provide advanced printing capabilities. This includes printing certain types of graphics on the label. These are installation specific; please contact the system administrator or ChemSW technical support to find out more about this feature.

Example: Here is an example of a label query and printer template using EPL2 (Eltron Printer Language) for sample labels:

QUERY (note materialid is in the select clause)

SELECT c.containerid,

      c.barcodeid,

      m.materialname,

      pi.pictocode,

      pi.graphicfilename,

      m.materialid

 from containers c,

      packdetail pd,

      packages p,

      materials m

      LEFT OUTER JOIN jct_pictograms_materials j ON (m.materialid = 

j.materialid and j.deleted = '0')

      LEFT OUTER JOIN pictograms pi ON (j.pictogramid = pi.pictogramid)  

where (m.materialid = p.materialid)

  and (p.packageid = pd.packageid)

  and (pd.packdetailid = c.packdetailid)

  and c.containerid = {containerid}

order by (pi.priority) asc

 

EPL (printer data for Eltron label printer. Note the _n suffixes for text wrapping)

I8,1,001

q664

S2

OD

JF

WN

D7

ZB

Q375,37

N

A41,5,0,2,1,1,N,"{materialname}"

A41,30,0,2,1,1,N,"{materialname_2}"

B41,60,0,3,3,8,70,N,"{barcodeid}"

A41,135,0,2,1,1,N,"{barcodeid}"

A41,170,0,2,1,1,N,"{custom:rcodes}"

A50,195,0,2,1,1,N,"{custom:rcodes_2}"

A41,225,0,2,1,1,N,"{custom:scodes}"

A50,250,0,2,1,1,N,"{custom:scodes_2}"

A41,280,0,2,1,1,N,"{custom:hazcodes}"

A50,305,0,2,1,1,N,"{custom:hazcodes_2}"

A41,335,0,2,1,1,N,"{custom:freetext}"

P1

 

For details on the printer template commands, consult the Eltron EPL2 documentation, but suffice it to say that the query and printer template shown here define a label that includes material name and a material synonym on the first row, container barcodeid as a barcode and then human-readable text on the second line, then 2 risk codes, 2 safety codes, 2 hazard codes, and a freetext field.

Using Params

Label Printers do not understand the concept of wrapping text fields. So if a label layout has a field that is 20 characters long on the stock, but the data provides it with 35 characters, one of two things happens: either the words print right off the margin of the label, or the printer tries to correct it by shifting it to the left and running over other elements on the page (and then runs off the opposite margin anyway). Fortunately, CISPro Global understands this and provides a mechanism for dealing with it. Each label configuration can have a list of "params." These are actually descriptions of how long a field can be, and it provides a text-wrapping feature. Each "param" in the list is composed of an alphabetic or symbol command, followed by a list of numbers and other specifications, separated by commas, that lay out the specifics.  Here is how it works:

An Example of Param Use

Suppose there is a user label that uses the following query:

select namefirst,userid from users where userid={userid}

 

And assume that there is a line to print the namelast field in the Printer Template:

A41,225,0,3,1,1,N,"{namelast}"

 

In this case, the "A" command is being used to print an ASCII text string. The number 41 is the horizontal start position, 225 is the vertical start position, 0 is the rotation, 3 is the font size selection, etc.  Finally, the word to be printed is the value of the variable "namelast."

The problem is that namelast can be up to 40 characters, but the space on the label only allows about 12. However, there is space to print another 12 characters for 2 more rows below the first one. This is where Params come in. First, the template needs to be changed so the system knows where to find additional space:

A41,225,0,3,1,1,N,"{namelast}"

A41,250,0,3,1,1,N,"{namelast_2}"

A41,275,0,3,1,1,N,"{namelast_3}"

 

Notice the namelast_2 and namelast_3 fields. They are extension fields, and they accept the overflow from the primary field. Also notice that there are no namelast_2 or namelast_3 columns in the query. This is critical!

Next, the Params list must be configured. This is as simple as listing the primary field name and how long each line can be:

namelast=12

 

Now, when CISPro Global goes to print this label with the namelast of "Someverylonglastnameski", it will actually send this to the printer:

A41,225,0,3,1,1,N,"Someverylong"

A41,255,0,3,1,1,N,"lastnameski"

A41,275,0,3,1,1,N,""

 

What happens if the name is longer than (3 x 12 = 36) characters? The extra characters will be excluded from the printed label.

Special Rendering Functions

CISPro Global provides a set for reserved tags which can be incorporated into the printer template to generate text which cannot be easily provided through a simple SQL query.

Example: The user may want to render a comma delimited list of Risk Phrase Codes on the label. The EPL template line to do this would be:

A41,210,0,3,1,1,N,"{custom:rcodes}"

 

Similarly for Safety Codes it would look like this:

 A41,210,0,3,1,1,N,"{custom:scodes}"

 

Or to list the phrases (including hazard categories):

A41,210,0,3,1,1,N,"{custom:rphrases}"

A41,230,0,3,1,1,N,"{custom:sphrases}"

A41,250,0,3,1,1,N,"{custom:hazcodes}"

 

To put each phrase on a separate line, the user must provide as many lines as needed, because the system will only render as many lines as the template provides. In the next example, up to three risk codes & phrases are listed on separate lines:

A41,210,0,3,1,1,N,"{custom:rloop1}"

A41,230,0,3,1,1,N,"{custom:rloop2}"

A41,250,0,3,1,1,N,"{custom:rloop3}"

 

Graphics

The user may also want to include graphics on a printed label. A good example is pictograms, the internationally recognized safety symbols that can be added to the Hazards tab of a chemical. The GG command is used to print a PCX format graphic that has previously been stored in printer memory. It is even possible to print several pictograms in one row, to conserve space on the label.  The following example uses the GG command with the graphic name 'loopg', the name CISPro Global used when the pictogram graphics were stored (and the name recognized by the Eltron printer). There are three pictos for this label, to be printed on the same line:

GG41,280,"{loopg:filename}"

GG250,280,"{loopg:filename}"

GG450,280,"{loopg:filename}"

 

Custom Tags

CISPro Global supports the following custom tags:

custom:rcodes - prints risk codes (beginning with R) as comma delimited list

custom:scodes - prints safety codes (beginning with S) as comma delimited list

custom:hazcodes - prints hazard categories (not beginning with R or S) as comma delimited list

custom:rphrases - prints the english text risk phrases, separated by comma

custom:sphrases - prints the english text safety phrases, separated by comma

custom:freetext - if there is a free text prompt, that content goes here

custom:rloop - must have an integer suffix 1-99, prints that index of the list of risk phrases

custom:sloop - must have an integer suffix 1-99, prints that index of the list of safety phrases

custom:hloop - must have an integer suffix 1-99, prints that index of the list of hazard categories

Prompts

Printed labels can be configured to prompt the user for input before printing. This can be achieved by adding prompt tags to the EPL template. The template can contain as many as 20 prompts.

Add User Prompts to a Label

1.Choose an existing line or create a new line in the printer template
2.End the line with the text {prompt:prompt text} where "prompt text" is the text that is displayed next to the text entry box shown to the user.
3.Save the changes

User prompt example The following prompt lines will appear as 2 text entry boxes on the label when, on the Print Label page, a user selects the label whose EPL contains them:

A41,165,0,3,1,1,N,"{prompt:Requested By}"

A41,190,0,3,1,1,N,"{prompt:Reason}"

 

print_labelLabelPromptFeature1

Bringing it all together

In order to make a printed label work, the following conditions must be met:

There must be a Printed Label defined with the correct Used For setting.
There must be a valid SQL query that contains the appropriate filter field name within curly braces in the query's WHERE clause.
The SQL query must contain the select field that is required for the custom code being used.
There must be a valid Printer Template for the type of printer being used, containing tags (field names from the query enclosed in curly braces).
Any set of {loop...} tags that represents data for the same query row must be placed together in the printer template script, and they should repeat in the same order.
Optionally, Params are defined to control how much text is printed per field and how to deal with overflow.

 

In addition, the user must be connected to the correct type of printer, and the user's local web browser must be able to print to that printer using a Generic Text Driver. Assuming all of these conditions are met, CISPro Global will print custom labels for specific purposes.

Custom Codes and Required Select Fields

Here is a table that contains each custom code, as well as the select field that must be included in the query on any label that uses it.

Custom Code

Required Select Field

Description

custom:rcodes

materialid

These codes list the set of R or S or Hazard Category (H) codes as a comma delimited list (a single line of text).

custom:scodes

materialid

custom:hazcodes

materialid

custom:sphrases

materialid

These codes list the set of R or S  phrases (the readable text version of the code) as a comma delimited list (a single line of text).

custom:rphrases

materialid

custom:methodslist*

sampleid

This code gives a comma delimited list of Method numbers.

custom:rloop

materialid

These codes list the set of R or S or Hazard Category (H) codes and phrases, one per line (so they need to be called as many times as there are possible lines).

custom:sloop

materialid

custom:hloop

materialid

Required Select Fields for Custom Codes (* = Material Qualification Module Only)