Overview & 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.1206.641

      The following release notes apply to Toolbox build 24.1.1206.641 MV Server Nesting Fix There was a reported issue occurring when users attempted to remotely process work orders using a nesting station on MV Server. When attempting to process the work ...
    • Microvellum Foundation Library Release Notes | Build 24.1127

      The following release notes apply to Microvellum Foundation Library build 24.1127. Additions Added a new Soffit product to the Upper Cabinet Accessories category. Added the Top Filler (Ceiling Scribe) option to Upper and Tall cabinets. (Corner ...
    • Toolbox Release Notes | Build 24.1.1125.641

      The following release notes apply to Toolbox build 24.1.1125.641. IRIB Setmill Location Fix Fig. 1: Setmill being moved to the start of the route (top) rather than at the center of a straight line, as intended (bottom). There was an issue reportedly ...
    • Toolbox Release Notes | Build 24.1.1105.641

      The following release notes apply to Toolbox build 24.1.1105.641 Nesting Fix Fig. 1: The fatal error that would occur during processing. There was reportedly an issue that occurred when clients attempted to process a work order using the nesting ...
    • Microvellum Foundation Library Release Notes | Build 24.1025

      The following release notes apply to Microvellum Foundation Library build 24.1025. Additions Added new global variable “Remove Stop Dado On Bottom Edge” for wood drawer boxes. Check this option to run the dado through at the bottom of the sub front ...