## Tutorial - Customizing a Report Template

Most of the time you won't need to create a brand new report template from scratch, but instead will want to create a new template based off an existing template that ships with PC-DMIS.
Suppose, for example, you have ballooned (or numbered) prints, and you want the ballooned numbers to appear in your a final report, such as in the Item column in the PPAP report (as shown in the figure to the right). Perhaps feature #15 on the print is the X dimension for a hole, feature #30 is the Y dimension, and feature #75 is the hole's diameter. How do you get this information into the Item column of your final report? One way is to configure the PPAP and label templates to pull the information from variables in your part program.

This tutorial shows how to make copies of the PPAP report and label templates and then demonstrates how to modify them so that the information that appears under the Item heading displays variables taken from your part program, instead of the normal sequential list of numbers that appears in the PPAP report.

How do you get ballooned data into the PPAP template?

This tutorial uses skills learned in the "Creating a Report Template" and "Creating Label Templates" tutorials. You should complete those tutorials first so that you have a proper foundation for this tutorial.

Step 1: Copy the PPAP Report and Label Template

The first thing you need to do is create copies of all the components used to generate the PPAP report. These include both the report template and the underlying label templates.

1. In the Report Template Editor open the PPAP.RTP report template.

2. Select File | Save As.

3. Name the report template "BALLOON_PPAP.RTP".

4. Close the Report Template Editor.

5. In the Label Template Editor open up these templates and select File | Save As on each, saving them with a "BALLOON_" filename prefix as shown in this table:

   Existing Label Template | Save As Filename
   PPAP_DIMENSION.LBL | BALLOON_PPAP_DIMENSION.LBL
   PPAP_DIMENSION_TRUE_POSITION.LBL | BALLOON_PPAP_DIMENSION_TRUE_POSITION.LBL
   PPAP_FCF_POSITION.LBL | BALLOON_PPAP_FCF_POSITION.LBL
   PPAP_FCF_SIZE.LBL | BALLOON_PPAP_FCF_SIZE.LBL
   PPAP_FCF_SUMMARY.LBL | BALLOON_PPAP_FCF_SUMMARY.LBL

You should now have copies of all the report and label templates used with the PPAP report. You will customize these copies in subsequent steps.

Step 2: Modify Rules in the Report Template

Now that you have created copies of the report and label templates you need to modify the rules on the new report template so that the newly saved BALLOON label templates are used instead of the usual PPAP labels.

1. In the Report Template Editor open the PPAP.RTP report template.

2. Access TextReportObject1 on the template and right-click on it to access the properties for the object.

3. From the Properties dialog box, click on Rules to access the Rule Tree Editor.

4. Expand the Dimensions list in the Rule Tree Editor. You will see several dimensions in bold face font indicating that a rule is applied to that dimension type.

5. Select each bold face item in the Dimensions list and modify its existing rule or rules so that the corresponding label templates with the "BALLOON_" prefix are used instead.

Existing Label Templates Used | New Label Templates to Use
PPAP_DIMENSION.LBL | BALLOON_PPAP_DIMENSION.LBL
PPAP_DIMENSION_TRUE_POSITION.LBL | BALLOON_PPAP_DIMENSION_TRUE_POSITION.LBL
PPAP_FCF_POSITION.LBL | BALLOON_PPAP_FCF_POSITION.LBL
PPAP_FCF_SIZE.LBL | BALLOON_PPAP_FCF_SIZE.LBL
PPAP_FCF_SUMMARY.LBL | BALLOON_PPAP_FCF_SUMMARY.LBL

Changing Label Template Used

6. Save the report template.

You have modified your existing rules so that the label templates with the "BALLOON_" prefix will be used to format and display your report data.

Step 3: Add ASSIGN Statements into your Part Program

Now that rules are modified, the next thing you need to do is insert ASSIGN statements into your part program for each ballooned item. Prior to each dimension in your part program, add ASSIGN statements for each characteristic you will display in that dimension. For example, at the beginning of this topic, we suggested that feature #15 on the print was the X dimension for a hole, feature #30 the Y dimension, and feature #75 the hole's diameter. If you had a LOCATION dimension to display the X,Y, and D values (three characteristics), you would insert these three ASSIGN statements prior to your dimension:

ASSIGN/V1[1] = 15
ASSIGN/V1[2] = 30
ASSIGN/V1[3] = 75

These statements create an array of multiple values for the V1 variable.

Apply similar ASSIGN statements before each dimension in your part program.

- If your dimension displays only one characteristic, then you would only put one ASSIGN/V1[#] before that dimension statement.

- If your dimension displays ten characteristics (for example, a TP FCF dimension) then you would need ten ASSIGN statements for the ten elements in your array:

> > ASSIGN/V1[1] = 2
> > ASSIGN/V1[2] = 4
> > ASSIGN/V1[3] = 6
> > ASSIGN/V1[4] = 24
> > ... and so on until ...
> > ASSIGN/V1[10] = 76

Important Note: In most cases, you must use the same variable name for all ASSIGN statements for all dimensions. This tutorial uses the variable V1. The exception is for a Position legacy dimension. For this dimension type you can use V1[1],V1[2] and so on for the XYZ axis. However, for diameters of features and datums and the position callout you should use unique variables, perhaps V2[1],V2[2] and V3[1] respectively. Also be aware that the variable can only take number characters. Alphabet characters will show only zeros in the report.

When you've finished adding in the ASSIGN statements, your part program is finished and ready to execute. The only thing left to do is to modify your label templates to read in the variable's array of values for each dimension.

Step 4: Modify Label Templates to Read Variables

In this step, you will open up each applicable label template and configure it so that it will read the array of values for the variable.

1. Inside the Label Template Editor, with the exception of BALLOON_PPAP_DIMENSION_TRUE_POSITION.LBL, open up the other label templates with the "BALLOON_" prefix given earlier.

2. Access the GridControlObject and access the contents of the first cell.

3. Modify the expression there to read as follows:

=INT(VARIABLE("V1[" + N + "]", ID:N))

4. Save each label template.

5. Finally, open BALLOON_PPAP_DIMENSION_TRUE_POSITION.LBL. Since this template has more than one row in the GridControlObject, you need to specify more than just the V1 variable.

- - For the XYZ axis, you can use the V1 variable in your expression:

=INT(VARIABLE("V1[" + N + "]", ID:N))

- - For diameters of datums and features, you need it to use the unique variable used earlier (such as V2):

=INT(VARIABLE("V2[" + N + "]", ID:N))

- - For the position callout, use another unique variable used earlier (such as V3):

=INT(VARIABLE("V2[" + N + "]", ID:N))

As the report increments through each dimension (using :N) the variable array is called with "V1[" + N + "]" and the Nth element of the V1 array is displayed. You are now ready for the final step, executing and viewing your results.

Step 5: Execute and View Results

In this final step you will define the report template to use in the Report window and then execute your part program and view your final results.

1. Save all your changes made to this point.

2. Access the Report window and load the BALLOON_PPAP.RPT template.

3. Execute your part program. You may also need to click the Redraw the Report icon from the Reporting toolbar after execution.

The Report window shows your final report. It should look something like this, displaying the numbered prints inside your PPAP report:

Final Report Showing Custom Numbered Items inside of a PPAP Report