1. Knowledge Base Home
  2. 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

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. 

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. 

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

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”

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). 

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.   

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. 

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

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

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. 

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. 

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). 

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. 

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. 

The blank report wizard should appear like this: 

Quick Overview of the available options: 

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. 

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. 

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

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 

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. 

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. 

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. 

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