Overview and Tutorial: Creating and Using Relations within a Report

Overview & Tutorial: Creating and Using Relations within a Report

Sometimes it is necessary to create a relation in the report to extract correct data from the Microvellum database. How will you know when this is necessary? It will help you to know when this is necessary if you understand a basic fact about databases.

One of the goals of database design is to eliminate redundant data. To accomplish this goal, related data is separated into tables. In Microvellum, you have a table with data relating to Products, such as the name of the product, the size of the product, etc. Since that table has product-related data, it should contain nothing relating to individual parts of the product – that data is contained in the Parts table instead.

Within the Microvellum Report Designer, you use ‘databands’ to define and locate what data is displayed where on the report. The databand must point to a data source within the Microvellum database. If you want to display part related data, that data source will look to the Parts table. Often though, there is data in another table that, while not Part level data, is somehow related to the parts and should be displayed on the report. An example might be that you want to display which product item number each part belongs to. This item number data is kept in the Products table.

The problem is that if you simply specify {Products.ItemNumber} as the expression, all the parts will have the first item number encountered in the products table. You don’t want that. Instead, you want all the parts that make up the product with item number 1.01 to display that number, all the parts that make up the product with item number 1.02 to display that number, and so on. This is how you know it will be necessary to create a relation in the report.

You create a relation between data sources in the data dictionary by selecting the child data source, in this case, Parts, and right-clicking to display the context menu.

 

 Click the menu item New Relation in the context menu of a data source.

 The screenshot below shows the New Relation dialog box.

 

Notice that there are nine fields, which define the relation parameters.

In the field Name in Source, the name of a relation is specified. Microvellum naming convention is: parent table name (in this case Products), followed by a hyphen, and then the child table name (in this case Parts).

By this name, the relation can be found in the data Dictionary, in a hierarchical structure, under the child table name if that’s the way it was set up.

If the relation between data sources will be created based on a relation in the source database, as is true here, then this name will coincide with the Name field (in this case, Products). This is a required field and is used to specify the name of a relation that is used to refer to this relation in the report.

The field Alias contains a separate user-defined name or hint for the relation that is displayed to the user. This is a required field. In the Microvellum report, it is set up to be identical to the Name field.

The field Parent DataSource contains the parent data source for this relation. This is a required field. Also, the field Child Data Source contains a detail or child data source for this relation. This is also a required field

The fields under Parent Columns display the selected column-keys from the parent data source. Enter the desired linking fields from the right box to the left box. This can be either one field or multiple fields.

The fields under Child Columns display the selected column-keys from the child data source. Enter the desired linking fields from the right box to the left box. This can be either one field or multiple fields.

The data in the Parent Columns and Child Columns area must be matching key data from the database tables to create the relation accurately.

You will now be able to drill from the Parts table, into the Products table, and specify {Parts.Products.ItemNumber} as your expression to correctly display the item number for each part.


    • Related Articles

    • Batch Printing Reports Using Report Groups (Tutorial)

      This article applies to Microvellum software builds 15.6.2201 and greater and provides typical steps for configuring and using the Report Groups to batch print selected reports.  See  Batch Printing Reports Using Report Groups (Overview)  in the ...
    • Batch Printing Reports Using Report Groups (Overview)

      Introduction Our users have requested a way to batch print reports, and in response to that request, we have added a tool to accomplish this in build 15.6.2201 or greater. The reason for this request is efficiency. If you consistently have 15 reports ...
    • Report Training Tutorial 5: Configuring a Master-Detail Report

      This is the last in a series of five Report Training Tutorial videos.  In this video, we'll develop a new Master-Detail report and introduce new concepts, including using Sub-Reports to better organize your report and make report development a little ...
    • Tutorial: Creating a Report with a Sub Report in Report Designer

      The articles in this section of the Knowledge Base involve working with Sub Reports for display in your reports. To learn more about Sub Reports, and how to access this section within the Report Designer, see Understanding Sub Reports in Report ...
    • Report Training Tutorial 4: Creating Master Detail Reports

      This is the fourth in a series of five Report Training Tutorial videos.  This video provides an introduction to Master Detail Reports including the required  Database Structure and Table Relations.  You'll learn how to create your own Master Detail ...
    • Recent Articles

    • Toolbox Release Notes | Build 24.1.0416.641

      The following release notes apply to Toolbox build 24.1.0416.641. Maestro Toolfile Fix There was an issue with Maestro SCM Toolfiles reportedly experienced by some users, wherein the labels output by autolabeling would be in incorrect positions, an ...
    • Toolbox Release Notes | Build 24.1.0409.641

      The following release notes apply to Toolbox build 24.1.0409.641 Saw Delimited Processing Station Figure 1: The Saw Delimited option in a custom processing station. New options have been added to saw processing stations to allow for control over data ...
    • Toolbox Release Notes | Build 24.1.0328.641

      The following release notes apply to Toolbox Build 24.1.0328.641 Fillet Token Fixes Issues were discovered in the use of fillet tokens on products that also had the IRIB setting enabled: Some users processed work orders with rounded parts, which ...
    • Microvellum Foundation Library Release Notes | Build 24.0322

      Additions Added the Master Angled Ends Cabinet. Added a Global prompt, "Hinge Plate Offset From Front" for easier control. Added “Double Division” option to Horizontal Designer Cabinets, 3 Door Cabinets, and other similar products. Added a new ...
    • Common Floating License Connectivity Issues

      This document lists common issues reported by users regarding the topic of Microvellum’s Floating License Activation (FLA) and the connectivity required for FLA to function. Firewall Blocking Activation of Floating License Some users have had an ...