1. Select File | Reporting | New | Label Template to access the Label Template Editor. A blank label template automatically appears.

2. Hide unused toolbars by right-clicking on the toolbar area and removing toolbars.

3. Hide unused PC-DMIS windows by selecting the open window from the View menu.

4. Maximize the template editor by clicking the maximize button
   the editor's window. You should see the words "LABEL" on the background of the editor.

5. Size The Frame/The View in the label template editing area to 4 inches wide and 1.5 inches high. You can do this by dragging on the bottom right hand corner of the label template and dragging the mouse. Use the rulers as a guide.

You have created a blank label template. When finished with this step, it should look something like this
:

Hint: When working with one of the template editors, you may find it helpful to hide your usual PC-DMIS toolbars and windows, thereby freeing up some screen space. If you work frequently with templates, you may want to create a stored screen layout for your template. For information on layouts, see the "Window Layouts Toolbar" topic in the "Using Toolbars" section.

Label Template Editor

1. Click the CommandTextObject icon
   . The pointer changes to a cross-hair.

2. Using the pointer, drag a box so that it stretches about 3 inches wide by .5 inches high. A CommandTextObject gets inserted into your label template. Right-click on it to access the Properties dialog box.

3. Click the Colors property. If PC-DMIS asks if you want to define a color set independent from the default application colors, click Yes.

4. The Color Editor appears. PC-DMIS uses this editor to define Edit window colors. However, in this case, it will only affect the current CommandTextObject.

5. Under Background Color, click Edit. A standard Color dialog box appears.

6. Give the object's background color a dark blue color. Change the values in the Red, Green, Blue boxes to 0, 0, 128 respectively to do this. Click OK.

7. In the Unmarked box, click Edit. A standard Color dialog box appears.

8. Select white, and then click OK. If PC-DMIS asks if you want to change the item's children, click No.

9. Use a bitmap image of a circle (or use the Ellipse object to draw a circle) and place it in the top right of the canvas.

You have added the CommandTextObject and a static Bitmap or Ellipse object for a circle shape into the label template. At the end of this step, your label template should looks something like this:

Label Template showing the CommandTextObject and a static Bitmap object

1. Click the GridControlObject icon
   . The pointer changes to a cross-hair.

2. With the pointer, drag a box for this object under the previously inserted CommandTextOjbect, so that it has the same width.

3. Size the height so that it nearly fills the rest of the Frame/The View. When inserted, the grid will show several rows and columns.

4. Access the object's properties, and then change the Columns and Rows properties to 3 each.

5. Select the object and select a cell. To do this, double-click on the first cell in the top row. It will highlight the cell in a blue background to show that you have selected it.

6. Select the entire top row. To do this, with the first cell selected press SHIFT, and click on the last cell in that row to select the entire cell. PC-DMIS highlights the entire row.

7. Right-click. The object's dialog box appears
   . This dialog box lets you control the formatting of the selected cells as well as insert text and expressions.

8. Click the Merge button to merge the selected cells.

9. Set the background color for the merged cell. Click the Background color button. A Color dialog box appears. Choose a dark blue color and click OK.

10. Set the text color for the merged cell. Click the Text color button and select white in the same way.

11. Create headings. Select the first cell in the second row and right-click to bring up the dialog box. In the Cell Expression box, type "Measured X". Close the dialog box and repeat the process on the second cell, typing "Measured Y". Finally. repeat it again for the last cell, typing "Measured Z".

12. Select the entire second row. Right-click and use the dialog box to select a light green background color.

13. Under Cell Justification, under Vertical, click the middle button
    to vertically center the text in their cells.

14. Click OK to close the dialog box and then deselect the object.

You have inserted a GridControlObject and learned how to change the number of rows and columns. You learned how to add text into a cell and how to format the grid by using this object's special dialog box. When finished with this step, your label template should look something like this:

Label showing the inserted and formatted GridControlObject

The GridControlObject's dialog box

1. Select the GridControlObject's first row.

2. Once it's selected, type "=ID" directly into the cell. This is an expression that tells PC-DMIS you want to display the feature's ID in the cell.

3. Select the first cell in the third row and type "=MEAS_X"

4. Select the second cell and type "=MEAS_Y".

5. Select the third cell and type "=MEAS_Z". These expressions tell PC-DMIS you want to display the feature's X, Y, and Z values. When you deselect the object, PC-DMIS displays the expression values from the filler text used by the object. See "About Report Expressions" for information on expressions.

6. Use the Border object and draw a border object around the label. You may need to resize the label to close to 4.5 inches wide by 2 inches high.

7. right-click on the border and give it a line width of 2.

8. Adjust the location of the contents so they are within the border.

You have added some report expressions into your label template and then drew a border around the template prior to testing it. When you finish this step your template should look something like this:

Label showing the results of the expressions

1. Select File | Save to save the label template. In the Save As dialog box, name the template "TestLabel.lbl".

2. Select File | Close to close down this template editor.

3. Select File | Reporting | Edit | Report Template and then select the Test1.rtp template file you created from the previous tutorial.

4. Select the TextReportObject you inserted into the first section of the report template and then access its properties.

5. Use the Rules Tree Editor and the Edit Rule dialog boxes to create a rule that will display TestLabel.lbl in that TextReportObject object for all measured circles. If you can't remember how to create rules, follow the procedure in the "Defining a Rule topic".

6. Select File | Save to save your report template.

7. Select File | Close to close it.

8. Execute the part program and apply the template.

9. Select View | Report window to display the final report.

After you save and test your label template, it should look something like this:

Report window example showing the newly created label. Notice the measured X,Y, and Z center point data for each circle feature.

So far, your label displays the XYZ of your circles' centers. Suppose, however, you wanted to get individual hit data instead. You can do this using repeating rows.

1. Select File | Reporting | Edit | Label Template. Select TestLabel.lbl from the dialog box and click Open. PC-DMIS loads the Label Template Editor and displays TestLabel.lbl.

2. Access the GridControlObject.

3. Select the first cell in the third row. Once you select it, right-click to bring up the GridControlObject's dialog box.

4. Click the Row tab.

5. Select the Repeating Group check box. This tells PC-DMIS that you want to make that row repeatable. The Repeat Expression dialog box becomes available. Notice that the row, at this point contains orange markers
   on the left and right sides. This indicates that the row is a repeating row.

6. Type "=N_HITS" in the Repeat Expression box. This tells PC-DMIS to get the total number of hits in the feature and to repeat the row for each available hit.

7. Click the Cell tab. You should see "=MEAS_X" in the Cell Expression box. Append ":N" to the expression so that it reads, "=MEAS_X:N". This tells PC-DMIS to repeat the expression in that cell for each available hit.

8. Select the other two cells in the row, and modify them so that they have the ":N" code added as well: "=MEAS_Y:N" and "=MEAS_Z:N".

9. Because the labels will expand to include all the data passed into the GridControlObject, when the row repeats, you do not need to adjust the label's size for this.

10. Click OK to close the GridControlObject's dialog box.

11. Save the label template and access Report window. Click the Redraw the Report icon from the Reporting toolbar to see your latest changes. Notice that instead of displaying the center point data for the circles, PC-DMIS displays individual hits.

You have learned how to create a basic repeating row to count and display several items of data without needing to create different report templates with different row configurations.

A row showing orange markers

1. Access the TestLabel.lbl label template and select the existing GridControlObject.

2. Select its first row. Once selected, right-click to bring up the GridControlObject's dialog box.

3. Click the Unmerge Cells button. The single cell making up the first row now becomes three cells.

4. Delete the "=ID" expression text in the first cell. You don't really need this expression in your final label template because the CommandTextObject displays it automatically.

5. Use the Background Color and Text Color buttons to change the cell's background color to white and its text to black.

6. Delete the inside column lines in the first row. To do this, select the first cell, access the dialog box, in the Cell tab, in the Lines area, change the line value of the Right list from Thin to None. Repeat this for the middle cell as well.

7. Click OK to close the GridControlObject's dialog box. While your label template may appear to have its cells merged, in reality, column lines in those cells are merely hidden.

8. Select the left cell in the first row and access the dialog box.

9. Click the Column tab. In the Column list box, type "Measured X". Click OK to close the GridControlObject's dialog box.

10. Repeat this for the middle and right cells, typing "Measured Y" and "Measured Z" respectively. You will use these column headings to control each columns visibility and ordering later on.

11. Select the CommandTextObject you added to the template earlier, and drag it down so that it rests on top of the GridControlObject's first row.

12. Modify the location or size of the Ellipse or circle Bitmap object you created earlier so that it's centered along the right side of the GridControlObject.

13. Select and then drag the top line of the Border object down so that it's just above the GridControlObject.

14. Drag a box around all the objects in the label to select them all. Then drag those objects up to the top and to the left as far as they will go on the label's canvas.

15. Right-click to access the GridControlObject's properties.

16. Type "TestTableFormat" in the Table Format property, and press TAB.

17. Save and close your label template.

In this step, you learned how to unmerge cells, set cell line properties, insert column headings, and select and move multiple objects. Defining column headings will let you control the visibility and ordering of your columns on the fly. When you have finished this step, your label template should look something like this:

1. Open the report template, Test1.rtp, in the Report Template Editor.

2. Select the TextReportObject and right-click to access the Properties dialog box.

3. In the Rules Tree property, click Rules to access the Rule Tree Editor dialog box.

4. Use the Rule Tree Editor and navigate to the rule you created earlier.

5. Select the rule and click Edit. The Edit Rule dialog box appears.

6. Click the Grid Format button. The Table Format Properties dialog box appears.

7. In the New Table Name box, type "TestTableFormat", and click Add Table.

8. Under the Columns list in the edit box, type "Measured X", and then click Add Column.

9. Add columns for "Measured Y" and "Measured Z" in this same manner.

10. Click OK on the various dialog boxes until your return to the Report Template Editor.

11. Select File | Save to save the report template.

12. Select File | Close to close the Report Template Editor.

In this step you tied the GridControlObject's columns to the TestTableFormat table in the Table Format Properties dialog box by adding columns with the exact same name and naming the table the same name you gave the Table Format property. Since you haven't changed the order or visibility at this point, the newly created table in the dialog box should look like this:

Table Format Properties dialog box showing the newly created TestTableFormat table

1. If not visible, select View | Edit Window to display the Edit window.

2. Place the Edit window in command mode.

3. Select Insert | Report Command | Table Format. The Table Format Properties dialog box appears.

4. From the Table ID list, select the TESTTABLEFORMAT table. The Columns area shows the columns available to this custom table format.

5. Clear the Measured Z box to hide that column in the final report.

6. Select Measured Y and click the up arrow icon next to the Columns area to reorder the Measured Y column so that it gets displayed first in the report.

7. Click OK. PC-DMIS inserts a TABLE/FORMAT
   command into the Edit window. This command controls the visibility and order of your columns.

8. Save and execute your part program. When PC-DMIS runs, notice that the order of the Measured X and Measured Y values have changed, and the Z column is hidden

In this final step you learned how to insert and use a TABLE/FORMAT command to define the order and visibility of the columns in the label template. Your finished report should look something like this:

Finished report showing only the Measured Y and X columns

TABLE/FORMAT,TESTTABLEFORMAT

COLUMN/ORDER,MEASURED Y,MEASURED X, ,

ROW/ORDER

### Tutorial - Creating Label Templates

This topic walks you through a basic tutorial that will create a simple label template with a few objects and a GridControlObject. This should give you a basic overview of how label templates work so that you can use them to display custom information in your reports.

This tutorial builds on skills you learned in the "Creating a Custom Report Template" tutorial; be sure to complete that section first.

Step 1: Create a Blank Label Template

Step 2: Add a CommandTextObject and Static Information into the Template

Step 3: Insert and Format a GridControlObject

Step 4: Add Expressions Into the GridControlObject

Step 5: Save and Test the Label Template

Step 6: Create a Repeating Row

Step 7: Use the Columns Tab to Define Columns

Step 8: Define a Grid Format Table

Step 9: Use Table/Format Command to Control Column Visibility and Order