---
title: QW QLM - ReportDefinition and QueryDesign Basics
description: This article describes how to create a basic QueryDesign and using that Query to create a basic ReportDefinition which can be used to show Qualiware content in a document format.
---

[Skip to content](https://customerportal.closereach.ca/knowledge/reportdefinition-and-querydesign-basics#main-content)

English

Show submenu for translations

<https://customerportal.closereach.ca/knowledge/kb-tickets/new?hsLang=en> [Customer portal](https://customerportal.closereach.ca/tickets-view?hsLang=en)

![Untitled design (11).png\]](https://customerportal.closereach.ca/hs-fs/hubfs/Untitled%20design%20(11).png?height=40&name=Untitled%20design%20(11).png)

Open main navigation

Close main navigation

- English
  
  Show submenu for translations
- <https://customerportal.closereach.ca/knowledge/kb-tickets/new>
- [Customer portal](https://customerportal.closereach.ca/tickets-view)

 Hello. How can we help you?

- There are no suggestions because the search field is empty.

1. [Knowledge Base Home](https://customerportal.closereach.ca/knowledge?hsLang=en)
2. [QualiWare Guides](https://customerportal.closereach.ca/knowledge/qualiware-guides?hsLang=en)
3. [Reports and Spreadsheets](https://customerportal.closereach.ca/knowledge/qualiware-guides?hsLang=en#reports-and-spreadsheets)

# QW QLM - ReportDefinition and QueryDesign Basics

## This article describes how to create a basic QueryDesign and using that Query to create a basic ReportDefinition which can be used to show Qualiware content in a document format.

Creating a GenericQuery 

 In the Repository Explorer find the **QueryDesign** template, right click, and select **New**. 

![](https://customerportal.closereach.ca/hs-fs/hubfs/undefined-Apr-19-2024-02-47-30-9676-PM.png?width=203&height=240&name=undefined-Apr-19-2024-02-47-30-9676-PM.png)

Open the **QueryDesign** and a window should pop up allowing you to choose which template(s) you want the first **ObjectQuery** to represent. If it does not automatically pop up, create an **ObjectQuery** in the Diagram editor. 

![](https://customerportal.closereach.ca/hs-fs/hubfs/undefined-Apr-19-2024-02-48-09-6439-PM.png?width=343&height=216&name=undefined-Apr-19-2024-02-48-09-6439-PM.png)![](https://customerportal.closereach.ca/hs-fs/hubfs/undefined-Apr-19-2024-02-48-15-8320-PM.png?width=255&height=217&name=undefined-Apr-19-2024-02-48-15-8320-PM.png)

Initially, just the object name is auto-populated as info to be pulled for the Query. Open the **ObjectQuery**. Select the property tab.  Right-click in the empty space and select **Insert**.  This will provide a list of attributes that can be chosen for the template. 

![](https://customerportal.closereach.ca/hs-fs/hubfs/undefined-Apr-19-2024-02-49-15-5815-PM.png?width=329&height=219&name=undefined-Apr-19-2024-02-49-15-5815-PM.png)

![](https://customerportal.closereach.ca/hs-fs/hubfs/undefined-Apr-19-2024-02-48-44-6745-PM.png?width=331&height=219&name=undefined-Apr-19-2024-02-48-44-6745-PM.png)

![](https://customerportal.closereach.ca/hs-fs/hubfs/undefined-Apr-19-2024-02-49-31-8031-PM.png?width=391&height=194&name=undefined-Apr-19-2024-02-49-31-8031-PM.png)

Reports will often have images of the diagrams (HTMLDrawing) and additional information such as Owner, HasResponsible, Description, etc.    

![](https://customerportal.closereach.ca/hs-fs/hubfs/undefined-Apr-19-2024-02-49-46-8497-PM.png?width=414&height=276&name=undefined-Apr-19-2024-02-49-46-8497-PM.png)![](https://customerportal.closereach.ca/hs-fs/hubfs/undefined-Apr-19-2024-02-49-53-2323-PM.png?width=146&height=143&name=undefined-Apr-19-2024-02-49-53-2323-PM.png)

Some objects, like **OwnedBy** and **HasResponsible** are Single Link objects, meaning when present on a report they will show up as a blue link.  To remedy this, double-click on these items in the property list.  In the window for each one, in the “**Attribute name:**” area, add “**.Name**” to each, and change **“CAST AS:”** to **“PlainText”**. 

![](https://customerportal.closereach.ca/hs-fs/hubfs/undefined-Apr-19-2024-02-50-19-7147-PM.png?width=688&height=458&name=undefined-Apr-19-2024-02-50-19-7147-PM.png)

This **ObjectQuery** will pull info from BPNs, but the objects in the BPN will need their own Object.  Double-click the object and select “**Expand from Metamodel**”. Select **Graphical** from the next popup (This implies a Graphical relation).  A new popup will appear, Full will select all templates available for the diagram, and “Only connected data” will only pull those used in the diagram(s)(Though this doesn’t always work and may populate other data anyway, which can be deleted). 

![](https://customerportal.closereach.ca/hs-fs/hubfs/undefined-Apr-19-2024-02-50-36-6228-PM.png?width=249&height=154&name=undefined-Apr-19-2024-02-50-36-6228-PM.png)![](https://customerportal.closereach.ca/hs-fs/hubfs/undefined-Apr-19-2024-02-50-42-1350-PM.png?width=206&height=175&name=undefined-Apr-19-2024-02-50-42-1350-PM.png)![](https://customerportal.closereach.ca/hs-fs/hubfs/undefined-Apr-19-2024-02-50-48-3949-PM.png?width=231&height=146&name=undefined-Apr-19-2024-02-50-48-3949-PM.png)![](https://customerportal.closereach.ca/hs-fs/hubfs/undefined-Apr-19-2024-02-50-54-7300-PM.png?width=304&height=144&name=undefined-Apr-19-2024-02-50-54-7300-PM.png)

Double-click the arrow icon in the upper left corner of the diagram, this will generate the query.  On the initial page ensure **Dynamic Execution** is selected.   

![](https://customerportal.closereach.ca/hs-fs/hubfs/undefined-Apr-19-2024-02-51-14-4153-PM.png?width=650&height=409&name=undefined-Apr-19-2024-02-51-14-4153-PM.png)![](https://customerportal.closereach.ca/hs-fs/hubfs/undefined-Apr-19-2024-02-51-22-4551-PM.png?width=688&height=285&name=undefined-Apr-19-2024-02-51-22-4551-PM.png)

The advanced query page will show the generated QSQL code that produces the GenericQuery and can be edited, however, if it is manually edited it will revert to its original code if the query is run again. 

![](https://customerportal.closereach.ca/hs-fs/hubfs/undefined-Apr-19-2024-02-51-32-7829-PM.png?width=688&height=285&name=undefined-Apr-19-2024-02-51-32-7829-PM.png)

The Attribute Definition page shows us the listed attributes we want to QueryDesign to generate. 

![](https://customerportal.closereach.ca/hs-fs/hubfs/undefined-Apr-19-2024-02-51-49-1830-PM.png?width=688&height=285&name=undefined-Apr-19-2024-02-51-49-1830-PM.png)

Clicking the **preview** button will show us the data this Query is generating for us. 

![](https://customerportal.closereach.ca/hs-fs/hubfs/undefined-Apr-19-2024-02-52-00-3232-PM.png?width=688&height=290&name=undefined-Apr-19-2024-02-52-00-3232-PM.png)

Setting the query up this way will pull the data from all BusinessProcessNetworks in the Repository. 

 

To have the report focus on one specific diagram insert this line into the **Advanced Query** page after the original lines of code: 

WHERE (T01.sys\_ObjectId = '\<qlmScript id="ObjID"\>' 

) 

 

And select a diagram in the “**Concerns**” Section. 

![](https://customerportal.closereach.ca/hs-fs/hubfs/undefined-Apr-19-2024-02-52-40-1140-PM.png?width=688&height=283&name=undefined-Apr-19-2024-02-52-40-1140-PM.png)

![](https://customerportal.closereach.ca/hs-fs/hubfs/undefined-Apr-19-2024-02-52-59-1245-PM.png?width=688&height=290&name=undefined-Apr-19-2024-02-52-59-1245-PM.png)

This will also show context-sensitive reports on the Web side, depending on which diagram you are viewing. 

 

**Report Definition** 

In the repository explorer find the **ReportDefinition** template (may need to use the expanded repository). Right-click, select **New**, name your ReportDefinition. 

![](https://customerportal.closereach.ca/hs-fs/hubfs/undefined-Apr-19-2024-02-53-24-6055-PM.png?width=231&height=395&name=undefined-Apr-19-2024-02-53-24-6055-PM.png)

Open the **ReportDefinition**. On the opening page, you can enter a ShortDescription and a title for the Report definition itself (not tied to any diagram). 

![](https://customerportal.closereach.ca/hs-fs/hubfs/undefined-Apr-19-2024-02-53-48-5792-PM.png?width=688&height=456&name=undefined-Apr-19-2024-02-53-48-5792-PM.png)

Navigate to the **Data Source** tab. In the Data Source dropdown menu select the **GenericQuery** generated from the QueryDesign, it will have the same name. 

![](https://customerportal.closereach.ca/hs-fs/hubfs/undefined-Apr-19-2024-02-54-01-1515-PM.png?width=511&height=351&name=undefined-Apr-19-2024-02-54-01-1515-PM.png)

Back on the first tab of the ReportDefinition select the **Wizard** button to open the editor for reports.  If you have not selected a GenericQuery or the Query is blank it will not open. 

![](https://customerportal.closereach.ca/hs-fs/hubfs/undefined-Apr-19-2024-02-54-15-7833-PM.png?width=298&height=43&name=undefined-Apr-19-2024-02-54-15-7833-PM.png)

The blank report wizard should appear like this: 

![](https://customerportal.closereach.ca/hs-fs/hubfs/undefined-Apr-19-2024-02-54-24-1130-PM.png?width=688&height=369&name=undefined-Apr-19-2024-02-54-24-1130-PM.png)

Quick Overview of the available options: 

![](https://customerportal.closereach.ca/hs-fs/hubfs/undefined-Apr-19-2024-02-54-41-6908-PM.png?width=688&height=369&name=undefined-Apr-19-2024-02-54-41-6908-PM.png)

**1 -** Top of the screen is the basic menus (File, Edit, View, Format) and font editing toolbar.   

**2 -** Beneath this is a toolbar with all of our alignment controls, sizing controls, Spacing, and other formatting options. 

**3 -** The toolbar to the left contains all possible options for objects being placed on the template. These objects will always be populated blank and can be formatted after being placed, however, this is usually not the best option for placing data.  The page info button will always populate its own data. 

**4 -** The box in the top right is where the data from the Query is displayed.  The report explorer, similar to the repository explorer, will show all the data in the report and which “band” it is populated in.  A blank report will only show the bands that are currently in the report including the headers and footers. 

** 5 -** The field list tab will show all the data that was put into our QueryDesign that can be used in the report.  The data under “Property” is pulled directly from the report definition, the data under “Table 1” is what was pulled from the generic query. Each object is given a number depending on how far down the query it is being pulled from.  It's descriptor you should recognize as the attribute you wanted to use. 

**6 -** The bottom right box is where data can be customized.  The things populated in this box will change depending on what kind of label is selected, but generally, this is where you will find Font info, the ability to add backgrounds, borders, and several other useful customization options.  

**7 -** This is where Group bands for sorting and filtering data can be set up, it is initially blank. It can also appear at the bottom of the screen.  There is also a “Preview” Button here, it has no current function.

 

 

In the upper right corner is the Report Explorer / Field list.  Click on the field list tab and expand Table 1.  This will reveal a list that is the sets of data we pulled using the QueryDesign.  Anything marked T01 is from the first Query object, T02 is the second, etc.  Anything under Property is from the Report Definition itself.  From here you can drag and drop any of the data elements into the Details field. 

![](https://customerportal.closereach.ca/hs-fs/hubfs/undefined-Apr-19-2024-02-55-37-1013-PM.png?width=688&height=369&name=undefined-Apr-19-2024-02-55-37-1013-PM.png)

Dragging and dropping the items from the field list will automatically make it the appropriate type of object in the Wizard (Rich text, Label, Image, etc.).  Alternatively, it is also possible to create a blank label and type text that is not tied to a diagram or to tie it to a data point. 

![](https://customerportal.closereach.ca/hs-fs/hubfs/undefined-Apr-19-2024-02-56-01-0867-PM.png?width=688&height=260&name=undefined-Apr-19-2024-02-56-01-0867-PM.png)

All labels have font customization options in the “Property Grid” in the bottom right when they are selected. 

![](https://customerportal.closereach.ca/hs-fs/hubfs/undefined-Apr-19-2024-02-56-15-7442-PM.png?width=465&height=392&name=undefined-Apr-19-2024-02-56-15-7442-PM.png)

After all labels and items are placed in the Wizard, exit, and save when the prompt appears.  To view the resulting report click the “View” button on the ReportDefinition 

![](https://customerportal.closereach.ca/hs-fs/hubfs/undefined-Apr-19-2024-02-56-47-3615-PM.png?width=688&height=458&name=undefined-Apr-19-2024-02-56-47-3615-PM.png)

Extra things – Report Header and Table of Contents 

Report Header 

A report header can be created by right-clicking anywhere on the page, selecting Insert Band, and selecting Report Header.  The Report Header is the title page of the report and will always be generated when viewed on its own page. 

![](https://customerportal.closereach.ca/hs-fs/hubfs/undefined-Apr-19-2024-02-57-23-4466-PM.png?width=526&height=444&name=undefined-Apr-19-2024-02-57-23-4466-PM.png)

The table of contents will always have its own page (Even if placed in the Report header) when the report is generated.  It can be selected from the left menu and placed on the page.  The title can be selected and customized. 

![](https://customerportal.closereach.ca/hs-fs/hubfs/undefined-Apr-19-2024-02-57-50-8944-PM.png?width=77&height=373&name=undefined-Apr-19-2024-02-57-50-8944-PM.png)![](https://customerportal.closereach.ca/hs-fs/hubfs/undefined-Apr-19-2024-02-57-57-9748-PM.png?width=688&height=143&name=undefined-Apr-19-2024-02-57-57-9748-PM.png)

To make the Table of Contents link to a diagram’s name, select the \[Name\] label and in the property grid select the Miscellaneous button (looks like a Wrench).  Next to “Bookmark” type select the little checkbox. In the Expression Editor, double-click ‘Name’ and press OK. 

![](https://customerportal.closereach.ca/hs-fs/hubfs/undefined-Apr-19-2024-02-58-22-2828-PM.png?width=468&height=353&name=undefined-Apr-19-2024-02-58-22-2828-PM.png)![](https://customerportal.closereach.ca/hs-fs/hubfs/undefined-Apr-19-2024-02-58-28-0462-PM.png?width=688&height=570&name=undefined-Apr-19-2024-02-58-28-0462-PM.png)

To add page numbers to the report select Page Info on the left and place it in the page footer. 

![](https://customerportal.closereach.ca/hs-fs/hubfs/undefined-Apr-19-2024-02-58-46-7794-PM.png?width=688&height=238&name=undefined-Apr-19-2024-02-58-46-7794-PM.png)

- [Compliance Management](https://customerportal.closereach.ca/knowledge/compliance-management?hsLang=en)
- [QualiWare Guides](https://customerportal.closereach.ca/knowledge/qualiware-guides?hsLang=en#main-content)

    - [Reports and Spreadsheets](https://customerportal.closereach.ca/knowledge/qualiware-guides?hsLang=en#reports-and-spreadsheets)
- [QualiWare Web Modelling](https://customerportal.closereach.ca/knowledge/qualiware-web-modelling?hsLang=en)
- [QualiWare Web Publishing](https://customerportal.closereach.ca/knowledge/qualiware-web-publishing?hsLang=en)
- [Governance Workflows](https://customerportal.closereach.ca/knowledge/governance-workflows?hsLang=en)
- [QualiWare Administration](https://customerportal.closereach.ca/knowledge/qualiware-administration?hsLang=en)

[![Chill listening crop-3](https://customerportal.closereach.ca/hs-fs/hubfs/Untitled%20design%20(11).png?width=120&height=24&name=Untitled%20design%20(11).png "Chill listening crop-3")](https://closereach.ca/)

Copyright © 2026, CloseReach