CYBRA Tutorial #1:

CYBRA Tutorial #1:
MarkMagic 7
Bar Code Label, RFID Tag, and SM@RT Forms Software
for IBM System i
Tutorial 2A: Version 7 Intermediate Concepts – Database Field Selection
CYBRA Knows Bar Code
help@cybra.com
Tutorial 2A: Intermediate Concepts – Database Field Selection Pg.
1
Welcome
Welcome to Part 2A of the MarkMagic 7 and JMagic 7 combined tutorials. This tutorial will introduce variable
text and barcode fields that use information retrieved from a database. As with the first tutorial, the steps are
split up and in different colors so you can focus only on the MarkMagic or JMagic steps separately.
Before we begin we are assuming:
1. You have completed the “Basic Concepts” tutorial and understand what was introduced. (You will
be making use of the format that you created and also utilize many commands and methods that
were introduced.)
2. You have a Hewlett Packard PCL compatible Laser Printer available at your location that is
configured for printing on the System i server. (If not, you can use our PDF option to produce your
output.)
In this tutorial, you will learn:
1. How to copy a format and why you would want to copy a format.
2. How to delete a field from a format.
3. How to add variable “non-*LINK” fields.
4. What a MarkMagic Data field is.
5. How to add Data fields defined from a database.
6. What a MarkMagic *LINK field is.
7. How to add text and barcodes that are “linked” to the variable data fields via *LINK.
8. What a MarkMagic label file is and how to create and copy sample data to one.
9. How to view the records in a label file.
10. How to print with data from your label file.
Tutorial 2A: Intermediate Concepts – Database Field Selection Pg.
2
Copying a Format
In this tutorial, you could make changes to your existing HPPCL5/LEARNXXX format, but you do not want
to lose your original work. (It will be used again in future tutorials.) Therefore, it’s best to make a copy of your
original format and use the new copy during this tutorial.
MarkMagic
Start MarkMagic and make sure you are at the main menu. Press “F” for Format and then “C” for Copy. The
Copy a format dialogue box will appear. You need to specify the source format device and name in the first
two fields. From device will be HPPCL5 and From format will be LEARNXXX. (Replacing XXX with your
initials.) Now you must specify the new format device and name. Since this will still be an HPPCL5 format,
To device will be HPPCL5. Now, specify a new name for the copied format. It cannot be the same name as
your original. For this tutorial, you will add a “2” at the end. Type LEARNXXX2 for To format. Leave To
User Library as *USRLIB (keep the copy within the same user library) and press ENTER.
You should eventually see a message stating that the copy completed successfully.
Tutorial 2A: Intermediate Concepts – Database Field Selection Pg.
3
When you start making changes, open your new LEARNXXX2 format instead of your original LEARNXXX
format.
Tutorial 2A: Intermediate Concepts – Database Field Selection Pg.
4
JMagic
Start JMagic and open the format that we made in the first tutorial by going to Format and then Open. Or you
can simply click the Open Format button.
On the Choose a Format window, click HPPCL5 and then choose your existing LEARNXXX format to open
it. We will use the new “Save As” feature in JMagic 7 to save your original format with a new name. This will
result in a new version of the format that we can modify in this tutorial leaving the original intact. With your
original format open, click Format and then Save As. Type LEARNXXX2 as the new name and click Ok.
You will get a message stating the save was complete. You will also notice that the format name has changed
in the information bar at the bottom of the format. Any changes you make from here will be made on your new
LEARNXXX2 format.
Tutorial 2A: Intermediate Concepts – Database Field Selection Pg.
5
Deleting a Field
You will be using the space between the two lines on your format to add new variable text and barcode fields.
There is a large barcode in the way though, so you are going to delete it to make way for your new field.
MarkMagic
Start MarkMagic and open your newly copied HPPCL5/LEARNXXX2 format. Press the PageUp and/or
PageDown keys to scroll the format up and down. Locate the barcode on your format. (Remember, to view left
or right, you can Press F19 or F20.)
Place your cursor anywhere inside of the box that represents the barcode and press F8. You will be told that the
field is about to be deleted. Press ENTER to delete the field.
Tutorial 2A: Intermediate Concepts – Database Field Selection Pg.
6
JMagic
Using your mouse, click on the barcode field to select it. You should see the red selection handles in the
corners of the barcode field. To delete the field, simply press the Delete key on your keyboard. You will be
asked if you are sure you want to delete the field. Click Yes to accept. The barcode field is removed from the
canvas.
NOTE: When editing in MarkMagic (green screen), changes are saved immediately when deleting/editing
fields, but in JMagic they are not. You must click the Save icon at the top for the changes to be saved back to
your System i.
Tutorial 2A: Intermediate Concepts – Database Field Selection Pg.
7
Adding New Fields
You will be designing the format seen on the following page. All of the fields that you see in between the
horizontal lines contain variable data retrieved from a database. You will be using a sample database file
included with MarkMagic called “SHIPFILE” which is located in library MMEXAMPLES. Once again, the
steps are numbered so you can skip ahead to the explanations if you wish.
NOTE: Once in the MarkMagic design screen, you may not be able to view your
entire format on the screen. You can scroll the format up and down with the
PageUp and PageDown keys. You can scroll the format left and right using F19
(Shift+F7) and F20 (Shift+F8).
NOTE: When adding fields, MarkMagic provides coordinate, length and height
values, etc. based off where you had your cursor on the screen at the time. You
can override these values in most of the steps in this tutorial to ensure that lines,
text fields, etc are placed exactly where you want.
JMagic takes it once step further and provides a “WYSIWYG” (What you see is
what you get.) view. This lets you see what the format will look like before you
print it.
Tutorial 2A: Intermediate Concepts – Database Field Selection Pg.
8
Tutorial 2A: Intermediate Concepts – Database Field Selection Pg.
9
#1 – Variable Text Fields: Non-*LINK
There are two basic ways to display variable data on your format. This section describes how to pass data
directly to a text field. There is nothing wrong with using this method in your designs, but you will discover
that using *LINK fields along with Data fields (next section) is much easier and keeps things neat and
organized.
MarkMagic
Place your cursor on the green design screen in the general area where the first letter of the company name
would be. Press F6 and add a text field. Previously, you left the Field Name as *HEADING, but now you must
prompt (F4) this field. You will be shown the List Field Options window.
This is the window you use to tell MarkMagic the type and location of the file you want to retrieve field names
and lengths from. Type 1 for Database fields. Next, type SHIPFILE for Database file and MMEXAMPLES
for Library. Press ENTER to accept. You will be shown a list of fields found in the SHIPFILE file.
Tutorial 2A: Intermediate Concepts – Database Field Selection Pg.
10
Page down and place your cursor on CSNAME and press ENTER. You will notice that Field name,
Description and Length have been brought into MarkMagic. (Field name is not *HEADING anymore.) All you
have left to do is type over the Row / Column values with 7.00 and 1.00 respectively so your field is placed
exactly where you want it. (We will leave the Font and Points at their default values for now.)
Once your text field settings match the screenshot above, press ENTER twice to create the field. You will see
the field placed on to your format with the name =CSNAME. The “=” lets you know that the field is a variable
field.
Tutorial 2A: Intermediate Concepts – Database Field Selection Pg.
11
The street address will be added in exactly the same fashion. Place the cursor just below the =CSNAME field
and press F6 and add a new text field. Prompt Field name and you will notice that MarkMagic remembers the
database information. Press ENTER to view the list of fields again. Page down and place your cursor on
CSADDR and press ENTER.
Once again, Field name, Description and Length are automatically brought into MarkMagic. Change Row /
Column values to 6.80 and 1.00 so the address is placed .2 inches below the Customer Name. Press ENTER
twice to create your second variable text field.
Tutorial 2A: Intermediate Concepts – Database Field Selection Pg.
12
JMagic
Click the Create a Text Field button at the top and then click on your form in the general location of the
customer’s name. You will be presented with the familiar Create a New Text Field window. Previously, you
created constant text fields by leaving the Field Name as *HEADING. Now you must click the Browse button.
Tutorial 2A: Intermediate Concepts – Database Field Selection Pg.
13
The Select a Field window will be shown. This is the window you use to tell JMagic the type and location of
the file you want to retrieve information from. Click on the Database Field tab. Next, type MMEXAMPLES
for Library and SHIPFILE for File. Click the Browse button next to Field.
You are shown a list of fields found in the SHIPFILE database file. Scroll down and click on CSNAME.
Click OK to select the field.
You will be brought back to the Select a Field screen. This time with the correct field name filled in for you.
Alternatively, if you know the database field name already, you can type it in without browsing for it fist.
Tutorial 2A: Intermediate Concepts – Database Field Selection Pg.
14
Click OK to accept your field settings and you will be returned to the Create a Text Field window. You will
notice that Field Name, Description and Length are automatically brought into JMagic for you. To place the
field exactly where you want it, change Row to 7.0 and Column to 1.0.
Tutorial 2A: Intermediate Concepts – Database Field Selection Pg.
15
Click OK to create your new variable text field. Notice the grey box with the label CSNAME. The grey box
represents the approximate length of the field if all 25 spaces were filled with text. The box also serves as an
indicator to you that the field is a variable field.
The street address field will be added in exactly the same fashion. Add a new text field just below the
CSNAME field. Click the Browse button next to Field Name to select a new database field. Notice how
JMagic remembers the names from your last selection. All you must do this time is click Browse next to the
Field parameter. Choose CSADDR and click OK. Click OK on the Select a Field window.
Tutorial 2A: Intermediate Concepts – Database Field Selection Pg.
16
Once again, Field Name, Description and Length are automatically brought into JMagic. To place the address
field .2 inches below the name, simply change Row to 6.8 and Column to 1.0.
Tutorial 2A: Intermediate Concepts – Database Field Selection Pg.
17
Click OK to add your second variable text field. You should see it just below the first field you created.
Tutorial 2A: Intermediate Concepts – Database Field Selection Pg.
18
#2 - Variable Text Fields: *LINK Fields
In many design scenarios, you would want to display the same bit of information more than once on a format
and in more than one fashion (i.e.: a barcode with human readable text below it.). Using the method explained
in Step #1, you would end up needing to create two fields each with different field names, but you would have
to pass the same variable data twice during print time. Obviously, this creates unnecessary extra work and you
shouldn’t need to pass the same data twice to a label.
MarkMagic *LINK fields extend MarkMagic formatting options by adding the capability to define a variable
field once, and have that same data appear in multiple fields on a format, each edited and formatted differently
if need be. You can link a text field to another text field for example, but the preferred method is to use Data
fields.
A MarkMagic Data field is a placeholder — a “bucket” to put information in at print time for further
processing. A Data field is a non-printing field that can have any of these MarkMagic special field names:
*HEADING, *DATE, or *TIME, or an OS/400 database fieldname. Just like a Text field or a Bar code field, a
MarkMagic Data field can contain constant or variable data.
A *LINK field can be composed of portions of different fields and can merge information from multiple bar
code, data, or text fields. *LINK fields enable printing of one bar code or text field from multiple sources of
data.
The City, State and Zip code line is actually one text field made up of 4 different data fields “*LINKed”
together. 3 of which are variable data retrieved from the SHIPFILE. Let’s see how it’s done.
Tutorial 2A: Intermediate Concepts – Database Field Selection Pg.
19
MarkMagic
First, you must add your Data fields. You can add them just like any other field. Since they are non-printing it
doesn’t matter where your cursor is when you add them, so place your cursor somewhere on the design area and
press F6 and then D for data. You will be presented with the Work with Data Field screen.
Since it is non-printing, you’ll notice that there are no coordinate values or fonts to choose. You just need to
specify a field name and length. Do this just like you did with the variable text field. Prompt the Field name
and SHIPFILE should still be there. Press ENTER and then page down to place your cursor on CSCITY.
Press ENTER to accept. MarkMagic automatically brings in the Field Name and Length.
Tutorial 2A: Intermediate Concepts – Database Field Selection Pg.
20
Press ENTER twice to accept your new data field. You should now see a +DATA in the top left hand corner.
This flag lets you know that your format contains Data fields. Data fields are not visible anywhere on the
canvas, that is why we use this flag to inform the user that the format contains Data fields.
Create two more Data fields following the same steps used to create CSCITY. The two fields that you should
add from SHIPFILE are CSST and CSZIP. Since these three new Data fields are non-printing fields, you
might want to know where they really are since you cannot see them on the canvas. Press F10 to toggle
between “Design View” and “List View”.
Tutorial 2A: Intermediate Concepts – Database Field Selection Pg.
21
Here in “List View” you get a listing of all fields on the format grouped by field type. Data fields are listed first
and here you can see the three Data fields that you created in the previous steps. You can also Page Up and
Page Down to scroll through the list of all fields on the format. You will see all Text fields grouped together,
then the Line and Box fields. Yu can still create fields while in “List View”.
Let’s add a “special” Data field; one that will be used more than once in the City/State/Zip text line. Since the
database does not contain a comma or spaces, you must devise a way to create your own. Press F6 and add
another Data field, but this time leave it as *HEADING. Remember when using Text fields that anything in the
description line prints when the Field name is *HEADING. Yes, this data field does not print, but when it is
used in a *LINK field, information entered in the Description will be what is linked to. Type a comma in the
description line, but as an important step, also make the length 2. This will allow us to link to a “space
character” when we need to link in spaces in our city/state/zip text field.
Tutorial 2A: Intermediate Concepts – Database Field Selection Pg.
22
Create the field as shown above and press ENTER twice to accept your new Data field. You will see the new
Data field added to the list of fields. Now it is time to create the *LINK field containing these data fields that
you made.
Tutorial 2A: Intermediate Concepts – Database Field Selection Pg.
23
Press F10 to toggle back to the “Design View”. Place your cursor just below the CSADDR address line you
made earlier in the tutorial. Add a new Text field. This time make the field name *LINK. Doing this will
unlock the Work with *LINK Source Fields screen. You must Page Down 3 times to get to it.
Press F6 to add a Source field (this is how you pick the fields that this new text field will be linked to). You
will be presented with a list of fields that have already been added to your format. The Data fields should be
listed at the top. You will add the Source fields in the order you want the text to appear. Place your cursor on
CSCITY and press ENTER. You will be brought to the Add a Source Field screen.
Tutorial 2A: Intermediate Concepts – Database Field Selection Pg.
24
At this screen, you decide whether you want to link the whole source field or just a segment of it. You would
like to see the whole city name print, therefore set the Start position to 1 and Length to 20. (These values
should already be present; MarkMagic always starts by linking the whole field.) Press ENTER twice to accept
your settings. You will see your new source field added to the list.
From here, you “build” the *LINK text field by adding new source fields to link to. You could simply add in the
State and Zip code, but there would not be a comma or any spaces. The field would print as just
“CITYSTATEZIPCODE”. This is where your “special” data field comes in. Press F6 to add another source
Tutorial 2A: Intermediate Concepts – Database Field Selection Pg.
25
field. Place your cursor on the *HEADING data field that you made and press ENTER. You want a comma
and one space, so you will want a Start position of 1 for a Length of 2. This will pull in the comma and that one
extra space from the Data field (you made the field length 2 so there would be that extra space after the
comma). Press ENTER. You will see the source field added to the list.
Next, it is time to link in the State. Press F6 and add in CSST. Leave the default Start position and Length.
Tutorial 2A: Intermediate Concepts – Database Field Selection Pg.
26
Now, you want to add in one space between the state and zip code. Press F6 and choose that same “special”
Data field again (you can link to the same field as many times as you need to). This time set the Start position
to 2 (you do not need the comma) and Length of 1. This will pull in the space character at the end of the Data
field Description. Press ENTER twice to accept and you’ll see the source field added to the list.
One last source field needs to be added and that is the Zip code. Press F6 again and choose the full length of
CSZIP. Your final source field list should look like this:
Tutorial 2A: Intermediate Concepts – Database Field Selection Pg.
27
Page back up to Work with Text Field and change the Row / Column to 6.60 and 1.00. This will put the last line
of the address in the correct spot. You can also provide a description for the field. Note, the description will not
print, it is just for informational purposes at this point. Press ENTER twice to create your *LINK field.
Tutorial 2A: Intermediate Concepts – Database Field Selection Pg.
28
JMagic
First you will add the data fields. Click the Create a Data Field button. The Create a New Data Field window
will appear. Since it is non-printing, you’ll notice that there are no coordinate values or fonts to choose. You
just need to tell JMagic that this is going to be a variable data field by providing a field name and length. Do
this just like you did with the variable text field. Press the Browse button next to Field Name.
Tutorial 2A: Intermediate Concepts – Database Field Selection Pg.
29
JMagic remembers the SHIPFILE that you used before. You need to select a different field though. Press
Browse next to Field and scroll down to CSCITY. Select it and press OK. Press OK again on the Select a
Field window and on the Create a New Data Field window to create the Data field.
Create two more Data fields following the same steps used to create CSCITY. The two fields that you should
add from SHIPFILE are CSST and CSZIP. Since these three new Data fields are non-printing fields, you
might want to know where they really are since you cannot see them on the canvas. To view the Data fields
you created, you can turn on the field list by clicking the “Turn On Field List” button at the top. This button
can be used to toggle on and off the field list.
Tutorial 2A: Intermediate Concepts – Database Field Selection Pg.
30
Turning on the JMagic “List View” you can get a listing of all fields on the format grouped by field type. Data
fields are listed first and here you can see the three Data fields that you created in the previous steps. You will
also see all Text fields grouped together, then the Line and Box fields. Tip: You can directly edit fields by
double clicking them in the list.
Tutorial 2A: Intermediate Concepts – Database Field Selection Pg.
31
Let’s add a “special” Data field; one that will be used more than once in the City/State/Zip text line. Since the
database does not contain a comma or spaces, you must devise a way to create your own. Create another Data
field, but this time leave it as *HEADING. Remember when using Text fields that anything in the description
line prints when the Field name is *HEADING. Yes, this data field does not print, but when it is used in a
*LINK field, information entered in the Description will be what is linked to. Type a comma in the description
line, but as an extra step, also make the length 2. This will allow us to link to a “space character” when we need
to link in spaces in our city/state/zip text field.
Tutorial 2A: Intermediate Concepts – Database Field Selection Pg.
32
You are now ready to create the *LINK text field that will contain the new data fields that you made. Add a
new text field just below the address field you made earlier. You need to tell JMagic that this is going to be a
*LINK field. Use the Field Name drop the menu and select *LINK.
You should see a new tab appear next to the “Display” tab. Click the new *LINK tab to reveal the JMagic
*LINK interface.
Tutorial 2A: Intermediate Concepts – Database Field Selection Pg.
33
The window on the left displays all of the fields currently added to your format. You “build” the text string by
inserting fields from the left into the right window pane. You will add source fields in the order you want the
text to appear. Select Data CSCITY and click the Insert button. This will add the CSCITY field to the list on
the right.
Tutorial 2A: Intermediate Concepts – Database Field Selection Pg.
34
At this point you can decide whether to link the whole source field or just a segment of it. You would like to
see the whole city name print; therefore you should set a Start position of 1 for a Length of 20. (These values
should already be present; JMagic always starts by linking to the entire field.)
Tutorial 2A: Intermediate Concepts – Database Field Selection Pg.
35
You could simply add in the State and Zip code Data fields, but there would not be a comma or any spaces
when you print. Just “CITYSTATEZIPCODE”. This is where the “special” data field comes in. On the left,
click on the Data *HEADING , and click the Insert button to add it to the list. You want a comma and one
space, so you will want a Start position of 1 for a Length of 2. This will pull in the comma and one space from
the data field. Make sure that the option for Variable Length just below that is set to No. This will stop
MarkMagic from suppressing spaces at the end of that individual source field. (We want the space.)
Tutorial 2A: Intermediate Concepts – Database Field Selection Pg.
36
Next, click on Data CSST and insert that to the list, making no changes to the Start position or Length.
Tutorial 2A: Intermediate Concepts – Database Field Selection Pg.
37
Tutorial 2A: Intermediate Concepts – Database Field Selection Pg.
38
Now, you want to add in one spaces between the state and zip code. On the left, click on Data *HEADING ,
and Insert it one more time. This time set the Start position to 2 (you do not need the comma this time) and
Length of 1. This will pull in the space character at the end of the data field description. As before, make sure
Variable Length is set to No (preserve all trailing spaces).
One last source field needs to be added to the list. On the left, select Data field CSZIP and insert it. Your final
list, on the right, should look like this:
Tutorial 2A: Intermediate Concepts – Database Field Selection Pg.
39
Now, click back on the Properties. Change Row to 6.6 and change Column to 1.0. This will place the text field
directly below the address line where it needs to be. You can also provide a description for the field. Note, the
description will not print, it is just for informational purposes at this point. Press OK to create your *LINK
field.
Click OK to add your new *LINK text field to your format. JMagic displays it as a grey box with the name of
*L: City State Zip. (The description shows in the grey box.)
Tutorial 2A: Intermediate Concepts – Database Field Selection Pg.
40
Tutorial 2A: Intermediate Concepts – Database Field Selection Pg.
41
#3 – Variable Barcode Field:
You are now going to add a variable data barcode to your format. It will contain the PO# number from the
SHIPFILE. You will be using the method described in Step #2. (Linking to a data field.)
MarkMagic
Place your cursor anywhere in your design area and press F6 and add a new Data field. Prompt the Field name
parameter and MarkMagic should still remember the SHIPFILE database. Find PO# in the list.
Place your cursor on PO# and press ENTER. MarkMagic will bring in the required information as shown
below:
Tutorial 2A: Intermediate Concepts – Database Field Selection Pg.
42
Press ENTER twice to create your new data field. Next, navigate to the area where the barcode will be placed.
Press F6, then B for Barcode, and then S for Standard. Remember, it will ask you to move the cursor up to
provide the height of the barcode. Move up about an inch and press ENTER.
Now, you are going to link the barcode to the data field that you just made. Name the field *LINK. Next,
PageDown 3 times to the Work with *LINK Source Fields screen. Press F6 to add a new source field and select
the Data field that you just created.
You do not need to make any changes to the Start position or Length, so press ENTER twice to add the new
source field.
Tutorial 2A: Intermediate Concepts – Database Field Selection Pg.
43
Your final Work with *LINK Source Fields screen should look like this:
Page back up to the Work with Bar Code Field screen. You need to make some changes here so the barcode
print correctly. Change the Row / Column to 4.50 and 3.00. This will place the barcode more towards the
middle of the page. Set Barcode Type to 22. This value represents Code 128 auto-switch. The PO# has letters
and numbers in it, so you must select a barcode that is capable of encoding all of the data. Set the Barcode
height to 1.50. Lastly, set the Narrow Bar Module width to 4.0. This will make the barcode print a little wider.
For a visual, the following screenshot shows all of these settings:
Press ENTER twice to accept your new barcode field.
Tutorial 2A: Intermediate Concepts – Database Field Selection Pg.
44
JMagic
Click the Create a Data Field button at the top and click Browse next to the Field name. JMagic should still
remember the SHIPFILE that you have been using. Next to Field, click Browse and select the PO# field.
Click OK three times to create your new data field. Now it is time to add the barcode. Click the Create a
Barcode button at the top and add the barcode in the middle of the format canvas. The Choose a Barcode Type
window appears. Pull the menu down, choose Code 128 (auto-switch) and then Click OK.
Just like the previous text field you created, you need to tell JMagic that it will be a *LINK field. Pull the
menu down next to Field Name and select *LINK. You will see the *LINK tab appear.
Tutorial 2A: Intermediate Concepts – Database Field Selection Pg.
45
On the left, click on Data PO# and insert the Data field to the list of Linked to Fields.
Next, click back to the Properties tab and type 4.5 for the Row and 3.0 for Column. Since the PO# field
contains numbers and letters, you must select a barcode type that is capable of encoding all of the data. That is
why we chose Code 128 (auto-switch) when we initially created the bar code. Two final settings for the barcode
must be set on the Display tab. Set the Height to 1.5 and set the Narrow Bar Width to 4.0.
Tutorial 2A: Intermediate Concepts – Database Field Selection Pg. 46
Click OK to create your new barcode.
Tutorial 2A: Intermediate Concepts – Database Field Selection Pg.
47
#4 – Variable Text Field: Barcode Human Readable Text
The last field to be added to this format is a text field placed directly below the barcode. The text will contain
the same information that is encoded in the barcode. You will create a text field that is linked to the same PO#
Data field that the barcode is linked to. This is the benefit of using Data fields + *LINK fields. You are able to
define the variable field once and use it in multiple places on the format.
MarkMagic
Navigate to an area just below your new barcode. Add a new Text field and name it *LINK as before. Page
down 3 times to the Work with *LINK Source Fields screen. Press F6 and add the same PO# Data field as a
source field that you used for the barcode. This will be the only source field you will need.
Page back up to the Work with Text Field screen. Change Row / Column to 4 and 3. That will place the text
exactly below the barcode. Change the Font to 36 (Arial) and the Points to 20.
Let’s get daring and make this text italic. Page down once and change Style to I. Press ENTER twice to create
your new barcode human readable text field.
Tutorial 2A: Intermediate Concepts – Database Field Selection Pg.
48
JMagic
Add a new text field below the barcode you just created. This will be a *LINK field, so pull the menu down
next to Field name and select *LINK. The Link Fields tab appears. Insert the Data PO# to the Linked to Fields
list.
Click back on to the Properties tab. Change the Row to 4 and change the Column to 3. This will place the text
field just below your barcode. Pull the menu down for Font and choose 36 Arial. Set the Point to 20.
Click the Font tab and change the Style to I (Italic). Click OK to create your new barcode human readable text
field. It is “linked” to the same Data field as the barcode, so whatever information is encoded in the barcode
will be printed in this text field. Make sure to click the “Save” icon at the top to save all of your changes back
to the System i.
Tutorial 2A: Intermediate Concepts – Database Field Selection Pg.
49
MarkMagic Label Files and Printing Variable Data
A MarkMagic label file is a physical file created by MarkMagic that contains fields that correspond to the
variable fields found within a MarkMagic format. The recommended way to create this “work file” is to use the
MarkMagic CRTLBLF (Create a Label File) command to create the OS/400 physical file for you. The
command can also be setup to copy in records of data from an existing database file. You will use this extra
functionality to add records of data to the file that will be used to print.
MarkMagic
At the MarkMagic main menu, type F for Format, G for Generate and then C for Create File. You will
immediately be asked which format you want to base the label file off of. Type HPPCL5 for Device, and
LEARNXXX2 for the Format.
Pressing ENTER will bring you to the Create a Label File command screen. The Format name is already
specified. Name the label file LEARNXXX2 and create it in library MRKMAGDTA. (It’s ok that the
database name be the same as the format.) Since you referenced the SHIPFILE database while creating the
format fields, take this opportunity to copy the data you need from SHIPFILE to your new label file. Type
SHIPFILE for Copy data from file and for library, type MMEXAMPLES.
Tutorial 2A: Intermediate Concepts – Database Field Selection Pg.
50
The rest of the parameters can be left at the default values. After pressing ENTER, MarkMagic will create the
new label file and also copy data from the SHIPFILE, but only filling in the fields that you referenced when
creating the format. You should be brought back to the MarkMagic main menu after the process is complete.
If you want to view the data in the label file, you can use the MarkMagic file editor by going to U for Utilities,
D for Data and E for Edit label file. You will be asked which format you will be using (should already be filled
in) and then you will be asked which label file you want to view. Type the name and library of your label file.
After choosing your label file, you will be brought to the Edit a Label File screen. Make sure Clear is set to
*NO (might need to press F10 to see all parameters) and press ENTER. You will see the data that has been
copied into your label file.
Tutorial 2A: Intermediate Concepts – Database Field Selection Pg.
51
Tutorial 2A: Intermediate Concepts – Database Field Selection Pg.
52
You can actually add or modify records at this screen, but the data that was copied in during the CRTLBLF
process is all that is needed for the purpose of the tutorial. Now that you understand what a label file is and how
the SHIPFILE data is retrieved and inserted into your “work file” label file, it is time to print these records with
your new format.
We will assume that you successfully printed in the last tutorial and know how to print a format layout to your
laser printer whether it is an AS400 device description or a remote out queue. From the MarkMagic main
menu, press P for Print, and, this time, L for Label File. You will be brought to the Print a Label File command
screen.
Now that you have a label file with some sample records of data inside of it, you can specify its name and
library in the first two parameters. (Previously you had this value set to *LAYOUT.) Make sure Format name
is LEARNXXX2. If your laser printer is setup as an AS400 device, type the name in Printer device. Also
make sure Printer type is HPPCL5.
Each record in the label file will result in one page being printed on your printer. So we don’t waste paper by
printing 17 pages (17 records in the label file), let’s set From Record to 1 and To Record to 3. (You may need
to press F10 to see these additional parameters.) Lastly, if you use a remote out queue to print, remember to
type this information in the Spooled Output Queue parameter. Press ENTER to execute this print command.
You should receive 3 pages each with different data in the middle corresponding to the first 3 records in your
label file.
Tutorial 2A: Intermediate Concepts – Database Field Selection Pg.
53
JMagic
With your LEARNXXX2 format open, click Format and then Create Label File.
You will be shown the Create a Label File screen. Make sure Format name is LEARNXXX2. Name the label
file LEARNXXX2 and create it in library MRKMAGDTA. (It’s ok that the database name be the same as the
format.) Since you referenced the SHIPFILE database while creating the format fields, take this opportunity to
copy the data you need from SHIPFILE to your new label file. Type SHIPFILE for Copy data from file and
for library, type MMEXAMPLES.
Tutorial 2A: Intermediate Concepts – Database Field Selection Pg.
54
Click OK to create your label file. JMagic will create the new label file directly on the System i server and
copy in data from SHIPFILE, but only filling in the fields that you referenced when creating the format.
If you want to view the data in the label file, you can use the new JMagic file editor by going to Format and
then Work With Label Files. It will bring up a list of files currently found in MRKMAGDTA library. Choose
the LEARNXXX2 file using the menu on the right and click Edit.
You will be presented with the JMagic database file viewer / editor:
Tutorial 2A: Intermediate Concepts – Database Field Selection Pg.
55
You can actually add or modify records at this screen, but the data that was copied in during the CRTLBLF
process is all that is needed for the purpose of the tutorial. Now that you understand what a label file is and how
the SHIPFILE data is retrieved and inserted into your “work file” label file, it is time to print these records with
your new format.
We will assume that you successfully printed in the last tutorial and know how to print a format layout to your
laser printer whether it is an AS400 device description or a remote out queue. Click Format and then Print and
then Print Label File. Now that you have a label file with some sample records of data inside of it, you can
specify its name and library in the first two parameters. (Previously you had this value set to *LAYOUT.)
Make sure Format name is LEARNXXX2. If your laser printer is setup as an AS400 device, type the name in
Printer device. Also make sure Printer type is HPPCL5. See the screenshot on the next page for the exact
parameters that you need to use:
Tutorial 2A: Intermediate Concepts – Database Field Selection Pg.
56
Each record in the label file will result in one page being printed on your printer. So we don’t waste paper by
printing 17 pages (17 records in the label file), let’s set From Record to 1 and To Record to 3. (You may need
to click the Advanced button to see these additional parameters.) Lastly, if you use a remote out queue to print,
remember to type this information in the Spooled Output Queue parameter. Click OK to print your format.
You should receive 3 pages each with different data in the middle corresponding to the first 3 records in your
label file.
Tutorial 2A: Intermediate Concepts – Database Field Selection Pg.
57
Congratulations! If all went well, you should have three nice looking pages of variable data. Let’s review what
was covered in this “Intermediate Database Concepts”:
Topics Covered:
11. How to copy a format and why you would want to copy a format.
12. How to delete a field from a format.
13. How to add variable “non-*LINK” fields.
14. What a MarkMagic Data field is.
15. How to add Data fields defined from a database.
16. What a MarkMagic *LINK field is.
17. How to add text and barcodes that are “linked” to the variable data fields via *LINK.
18. What a MarkMagic label file is and how to create and copy sample data to one.
19. How to view the records in a label file.
20. How to print with data from your label file.
This tutorial only covered methods of printing information from a database. If you are looking for a tutorial that
covers printing data retrieved from a spooled file, please see tutorial 2B: “Intermediate Forms Concepts”.
Tutorial 2A: Intermediate Concepts – Database Field Selection Pg.
58
Was this manual useful for you? yes no
Thank you for your participation!

* Your assessment is very important for improving the work of artificial intelligence, which forms the content of this project

Download PDF

advertising