### Tutorial - Creating a Custom Report

This topic walks you through a very basic tutorial that will result in you creating a simple custom report. This should give you a basic overview of how Custom Reports are created within the Custom Reporting Editor and how they interact with existing label templates so you can later create and use your own custom reports.

Before beginning this tutorial, create a simple part program that has four measured circles on a simple part and four Circularity dimensions, one for each circle. This tutorial uses the Hexagon test block (Hexblock_Wireframe_Surface.igs).

Create a part program that measures four circles, similar to this.

Click on the links below to expand or collapse each step of instructions as needed. Some steps may also include a demo of that step. Simply click on blue icons like this one to see the demos:
Clicking these icons will launch demo movies showing how to accomplish certain tasks. When viewing these demo movies, you should maximize the help file viewer or browser window to more easily see what's happening.

Step 1: Setting up the Work Environment

In this tutorial you will use the Edit window in Summary mode along with the Custom Reporting Editor. Set them up so they are both visible as follows:

1. Access the Edit window.

2. Place the Edit window into Summary mode.

3. Select File | Reporting | New | Custom Report from the menu bar. The Custom Report Editor appears.

4. Hide any unused toolbars by right-clicking on the toolbar area and removing them.

5. Hide any unused PC-DMIS windows by selecting the open window from the View menu. Keep the Edit window open.

6. Maximize the Custom Report Editor by clicking the maximize button in the upper right corner of the editor's window. You should see the words "CUSTOM" on the background of the editor.

7. Drag the Edit window underneath the Custom Report Editor's Object Bar. Your work environment should now look something like this:

   Custom Report Editor

Hint: When working with the Custom Report Editor, 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 this editor, you may want to create a stored screen layout for it. For information on layouts, see the "Window Layouts Toolbar" topic in the "Using Toolbars" chapter.

Step 2: Dragging, Dropping, and Positioning Objects

In this step you will drag the report items into the Custom Report Editor.

1. From the Edit window in Summary mode, select File Header and drag it out onto the editor. You will notice a transparent image of that item's icon as you drag it out onto the work area.

2. Release the mouse button. PC-DMIS creates a File Header object in the editor.

3. Drag and drop CIR1 and CIR2 onto your report. Don't worry about positioning them properly. For now, just drop them into any empty space on the first page of the report.

4. In the Report Editor, select the File Header object already in your report and drag it to a place near the top of the report and center it horizontally on the Page.

5. Next, select the label object for CIR1 and drag it so that the top edge is just under the bottom edge of the File Header object. Try to align their left sides as well. Drag it slowly until a blue arrow appears. Then release the mouse button. This aligns the dragged object's left side with the object above it.

6. Repeat this step for CIR2.

7. Now, drag the CIR3 feature from the Edit window to the bottom of the label used for CIR2. Notice that as you move your mouse over the various labels already in the editor, green handles appear around the labels. When the blue arrow appears just below CIR2, release the mouse. The feature is dropped into the editor below CIR2 and the label object for it becomes automatically aligned with the object above it.

8. Repeat the above step for CIR4, attaching it just below CIR3.

9. Select File | Save. A dialog box will appear allowing you to save your report. Choose any name and click Save.

Your Custom Report Editor should look something like this:

Step 3: Using Multiple Pages

In this step you will work with multiple pages. You will add two additional pages and modify one page to support a different page size. Then you will rearrange the pages.

1. In the Report Editor, at the bottom of the page, right-click on the Page1 tab and select Insert. A new page appears, called Page2.

2. Right-click on that page and the Properties dialog box appears.

3. Change Height to 850 and press TAB.

4. Change Width to 1100 and press TAB. Changing these two properties essentially formats the page for Landscape printing.

5. Create a third page, Page3.

6. Right-click on Page2 and click Move Right. Notice how this moves the Page2 tab to the right of Page3.

7. Right-click on Page3 and click Move Left. Your pages are now reordered to show Page3, followed by Page1, followed by Page2. In this way you can easily rearrange your pages.

8. Save your report.

Your report now has three pages and their order has been changed.

Step 4: Dropping onto Other Objects

This step demonstrates how you can replace existing label objects with new label objects and how to use the CADReportObject inside a custom report.

1. In the Custom Report Editor, select the Page1 tab. To replace any object in your report, simply drag and drop any other item of a similar type on top of it. For example, you can drop any item that uses labels on top of any existing label in your editor.

2. Select the label in your report for the CIR1 feature. You should already have four Circularity dimensions. If not, create them now, one for each circle feature.

3. Drag the Circularity dimension for the CIR1 feature from your Edit window and drop it on top of the feature label already in your report editor for CIR1, like this:
   Notice that the label object is updated with a new label object.

4. If the updated object moved, reposition it.

5. Drag the other dimensions on top of their respective feature labels in the editor. PC-DMIS updates all the labels accordingly so that they look something like this:
   Report Editor Now Showing the Four Dimension Labels

6. Now, click on the Page2 tab. Drag a CADReportObject from the Object Bar onto that page, and size it so it fills the page.

7. Drag the four dimensions one at a time on top of the CADReportObject. For this object, notice PC-DMIS does not replace it with a label object for the dimension. Instead, PC-DMIS automatically creates the appropriate labels and leader-lines on top of the CADReportObject for the dimensions.

8. Save your report.

Page1 now has dimension labels instead of feature labels, and the CADReportObject in Page2 should look something like this:

Step 5: Inserting Data Items

In this step you will insert a GridControlObject and get it ready to display values from the Edit window. You will then drag the measured and nominal values from a feature's data items into the available cells of the object.

1. Click on the Page3 tab.

2. Click on the GridControlObject icon and drag the object onto the page.

3. Access the Properties dialog box and set NumRows to 8 and NumCols to 3.

4. In the first row, the middle cell, double-click, and then type "Nominal". In the right cell, do the same and type "Measured".

5. Starting with the first row, and first column, and then moving down through the other rows type "X", "Y", "Z", "I","J" ,"K", and "Diameter". This will fill in rows 2 through 8 in column 1. Your GridControlObject should look like this:

A GridControlObject with Static Text

Note: Remember when typing information into a cell, you must click in another cell or press TAB for the value to actually be displayed.

6. In the Edit window, click the plus sign next to CIR1, and then click the plus sign next to Theoreticals. You will see a list of data items.

Data Items in the Theoreticals List

7. Drag the Theoretical X data item and drop it into the Row 2, Column 2.

Dragging the item | Dropping the Item

8. Double-click on the item you just dropped into the cell. You will see that cell is not really holding static text. Under the hood, the cell actually holds the expression needed to display the data. This means the information is not hard coded and if it changes, your report will be changed as well to match.

Looking at the Data Item's Expression

9. Continue to drag and drop the remaining data items from the Theoreticals list into the appropriate cells in the Nominal column.

10. In the Edit window expand the Actuals list for CIR1 and drop the data items into the appropriate cells of the Measured column.

11. Expand the Settings list for CIR1, and drag and drop the ID data item into the cell at row 1, column 1.

12. Finally, apply some text and background formatting of your choice to row 1 and column 1, and then save your report. The GridControlObject should look similar to this:

A Sample GridControlObject containing Data Items

13. Select File | C lose to close the Custom Report Editor.

Your values may differ depending on the part and circles measured.

This step demonstrated how to drag and drop data items into a GridControlObject.

Note: Data items don't have to be dropped only onto a GridControlObject; you can also drop them onto the editor's page directly.

Step 6: Viewing, Updating, and Printing your Report

This final step explains how to load your custom report into the Report window, how to view it, how to update a report from a part program that changes, and finally how to print it.

1. Select View | Report Window to access the Report window.

2. From the Report window toolbar, select the Custom Report Selection Dialog icon. A dialog box appears showing all custom reports.

3. Select your report and click Open. Your report appears in the Report window.

4. Next, you will update your report. Select File | Reporting | Edit | Custom Report. A dialog appears showing all the reports you've created for your current part program.

5. Select your report and click Open. Your report opens inside the Custom Report Editor.

6. Go ahead and make any change to your report in the editor and then save your report again.

7. To get the newly updated report to appear in the Report window, simply re-execute your part program, or click the Redraw icon from the Reporting toolbar.

8. Finally, you need to print your report. Select the File | Printing | Report Window Print Setup... menu item.

9. Select the Printer check box at the dialog box to send it to your printing device.

10. From the Report window's Reporting toolbar, click the Print icon. PC-DMIS prints your report.

In this step you've loaded an existing report into the Report window, updated it, and then sent it to your printer.

Congratulations! You've successfully completed the Creating a Custom Report tutorial.