Sunteți pe pagina 1din 43

alfabet Custom Reports 7.

1
Advanced Reporting
Cookbook

alfabet Custom Reports 7.1 - Advanced Reporting - Cookbook

This document contains the follow-up material for your custom report training for advanced
reporting. It assumes that the reader has taken part in both a basic and advanced reporting
course and feels comfortable writing alfabet and/or SQL queries.
Use the following pages to memorize the trainings contents and exercises. Based on the
screenshots in this document, you can re-build some of the reports which were developed
during the training, step by step. Additionally, you will find some helpful hints next to most
screenshots.
This document is intended to be an aid to memory. The eXpand documentation (expand.pdf)
provides in-depth information about all properties and options concerning report definitions
and the alfabet Query Language.
Recent configuration changes are marked as new in 7.1.

Chapter Overview
The chapters Graphical reports, Business Chart Reports and Editable Matrix Reports
describe how to create and configure reports of the respective type. The chapter Graphical
reports also contains information about color rules, size rules and indicator rules.
In the chapter Limitations of Native SQL Reports, you will find some information on what to
keep in mind when using SQL queries in planningIT. There is also information about the
correct usage of instructions.

alfabet AG

alfabet Custom Reports 7.1 - Advanced Reporting - Cookbook

Table of Content
1

GraphicalReports............................................................................................................................4
1.1

TreeMapReports.....................................................................................................................4

1.2

LayerDiagramReports.............................................................................................................6

1.3

LaneReportsnewin7.1.......................................................................................................9

1.4

&1.5GridReports&ClusterMaps....................................................................................13

1.6

&1.7&1.8MatrixReports.............................................................................................16

1.9

LifecycleReports(GanttCharts).............................................................................................20

1.10

EvaluationReports...............................................................................................................23

1.11

HTMLbasedIndicatorReportsforObjectViews................................................................25

1.12

MultipartReports(WorldMap)..........................................................................................26

1.13

CustomizationRules.............................................................................................................28

1.13.1

ColorRules.....................................................................................................................29

1.13.2

IndicatorRules...............................................................................................................30

1.13.3

SizeRules........................................................................................................................30

BusinessChartReports(Pie,Line,BarandRadarCharts).............................................................31

EditableMatrixReports.................................................................................................................34

3.1

&3.2EditableRelationshipMatrixforReference/ReferenceArray.................................34

3.3

EditableRelationshipMatrixviaRelationshipClassnewin7.1.........................................37

3.4

EditableRelationshipMatrixforBusinessSupports...............................................................38

LimitationsofNativeSQLReports.................................................................................................40
4.1

REFSTRinSELECT....................................................................................................................40

4.2

ExamplesforJOINS.................................................................................................................40

4.3

FiltersinSQLreports...............................................................................................................40

4.4

CascadingFiltersnewin7.1...............................................................................................41

4.5

DataTranslation......................................................................................................................41

4.6

EvaluatingMandates..............................................................................................................42

4.7

UsingInstructionsinNativeSQLReports...............................................................................42

alfabet AG

alfabet Custom Reports 7.1 - Advanced Reporting - Cookbook

Graphical Reports

This chapter will look at the different types of visual reports you are able to create with
eXpand.
At the end of this chapter, customization rules such as color rules, size rules and indicator
rules are also described in details.
Please note that different types of customization rules are only applicable to certain
types of graphical reports.
1.1

Tree Map Reports

Tree Map Reports list a number of objects on a horizontal axis, and below each object a list
of related objects.
These objects can be colored, display an indicator, and can be differently sized.

Creating a Tree Map Report


1.
2.
3.
4.
5.
6.
7.

Create a new report


Set Type = Custom
Set Template = TreeMapReport
Right click report and select Create Custom Report View
Right click report and select Start alfabet Report Assistant
Set the Layout = TreeMap
Right Click on the Root Queries and Add New Root Query

alfabet AG

alfabet Custom Reports 7.1 - Advanced Reporting - Cookbook

Building Root Queries for Tree Map Reports


1. In the Root Query click on Alfabet Query and on the ellipsis button [...] to open the
Alfabet Query Builder
2. Choose the class from which the objects will be used for columns
3. Specify the Properties that are to be displayed from the class
It is possible narrow results down with filters by adding Where parameters if required.

Adding class entries


Class entries are used in the Tree Map Report to fill the columns with content.
1.
2.
3.
4.
5.
6.

Right click on Name of the Tree Map Report and Add new Class Entry
Select the class that also has been used for the Root Query
Right click on the Class Entry and Add new Query
Click on the new query and open the Alfabet Query Builder
Select the Class that should actually be used to fill the columns
With the query join the class that has been used as the base or like in the displayed
case the class that is directly connected to the base class
7. Add a Where filter with the :BASE parameter related to the base class

alfabet AG

alfabet Custom Reports 7.1 - Advanced Reporting - Cookbook

1.2

Layer Diagram Reports

Layer Diagrams display objects of connected classes arranged in layers (one layer per
class).
On the finished report, the user can select any one object. Clicking Show Connected Items
will reveal which objects or foreign classes are connected to the selected object.
Objects of the report can be colored using color rules, and can display indicators using
indicator rules.

alfabet AG

alfabet Custom Reports 7.1 - Advanced Reporting - Cookbook

Creating a layer diagram definition


1.
2.
3.
4.
5.

Create a new report


Set Type = Custom
Set Template = TreeMapReport
Right click report and select Create Custom Report View
Right click report and select Start alfabet Report Assistant

alfabet AG

alfabet Custom Reports 7.1 - Advanced Reporting - Cookbook

6. Set Layout = LayerDiagram


7. Right-click Root Queries and select add new Root Query
8. For each object class selected by your query, add a new Class Entry (right-click
report node and select add new Class Entry)

The objects displayed in the column headers and the columns of the report are found via
queries defined for the elements of the report. The queries can either be native SQL queries
or alfabet queries.
The information displayed in the object boxes of the report is identical to the column headers
that result from a tabular output of the defined query.
The first column of the output of a native SQL query, as this column must specify the
REFSTR of the object for technical reasons and is ignored in the visible output.
Creating a layer diagram Query
The complete content of the report is defined in one query resulting in a grouped data set.
When separate queries are defined, a high number of queries must be executed by
the database to display the report (eXpand 6.1). This can lead to performance issues.
Therefore, it is recommended to base the report on a grouped dataset defined in a
single query (eXpand 7.0 and later).

alfabet AG

alfabet Custom Reports 7.1 - Advanced Reporting - Cookbook

Add GroupBy_Ex and RemoveColumns Instructions:

1.3

Lane Reports new in 7.1

Lane Reports display lanes containing various objects, and show connections between these
objects in the form of arrows. Like Layer Diagrams, Lane Reports have a Show Connected
Items button.
Objects of the report can be colored using color rules, and can display indicators using
indicator rules.

alfabet AG

alfabet Custom Reports 7.1 - Advanced Reporting - Cookbook

Creating a lane report definition


1.
2.
3.
4.
5.

Create a new report


Set Type = Custom
Set Template = LaneReport
Right click report and select Create Custom Report View
Right click report and select Start alfabet Report Assistant

alfabet AG

10

alfabet Custom Reports 7.1 - Advanced Reporting - Cookbook

11

Defining the Lane Report


1. Right-click the root node and select Add New Lane. Create as many lane entries as
you need. For each lane entry, a sub-node called Node and a sub-node called Link
are automatically created.

2. On each lane node, select Add New Query. Specify a query that returns the desired
objects to be displayed in that lane. (You can add more than one query element here
lanes are not limited to displaying objects of only one class.)

3. On each link node that has a predecessor and a successor lane node, select Add
New Query. Specify a query that returns the REFSTR of both lane nodes object
classes. (If one of the connected lane nodes has more than one query, the link node
will also need to have more than one query.)

alfabet AG

alfabet Custom Reports 7.1 - Advanced Reporting - Cookbook

Note that the last lane node will not have to have a link node query, as that link will
not have a second lane node to connect to.

4. Lastly, go to the link nodes themselves. On each link node, enter the returned
REFSTRs of the two connected lane nodes objects to the FromColumn and
ToColumn property. This way, the link node will know exactly how the lane objects
are connected with each other.

alfabet AG

12

alfabet Custom Reports 7.1 - Advanced Reporting - Cookbook

1.4

& 1.5

13

Grid Reports & Cluster Maps

Grid Reports display hierarchical relations in form of a tree.


Cluster Maps are grid reports with a slightly different layout: related objects are not displayed
as tree twigs, but as smaller cells contained in their parent objects cell.

Creating Grid Reports


1.
2.
3.
4.

Create New Report


Set Type = Custom and select Template = GridReport
Right click on the report and create the Report View
Right Click on the Report and start the Alfabet Report Assistant

Defining the Grid Report


1. Right click on the name of the report and Add New Cell
2. Right click on the cell and Add New Item

alfabet AG

alfabet Custom Reports 7.1 - Advanced Reporting - Cookbook

14

3. It is required to specify the Class Name for the new item (for the first class its usually
the base class that is to be used). Create subordinate items for all subordinate
classes that will be used in the query.
4. Right Click on the first Item and Add New Query
5. Click on the query and open the Alfabet Query Builder

In the cell settings it is mandatory to specify what kind of grid report the user wants to create:

Adding instructions
1. Switch to the tab Instructions.
2. Use the GroupBy_Ex instruction to group the displayed properties
3. Its mandatory to use the REFSTR property for the the group by function. It doesnt
work properly with other properties.
4. Add a RemoveColumns instruction to hide REFSTRs from the final report

alfabet AG

alfabet Custom Reports 7.1 - Advanced Reporting - Cookbook

15

It is possible to add Color Rules and Indicator Rules. The creation process is the same as
in Tree Map Reports.

alfabet AG

alfabet Custom Reports 7.1 - Advanced Reporting - Cookbook

1.6

& 1.7 & 1.8

16

Matrix Reports

Matrix Reports can display any relationship in matrix form.


There are currently three types:

Matrix Report (Diagram)


In reports of the type Diagram,
- the column and row headers will scroll out of the screen,
- boxes will be displayed with rounded corners,
- an indicator rule can be used for cell objects

Matrix Report (Affinity)


In reports of the type Affinity,
- the column and row headers are fixed during scrolling,
- boxes will be displayed with sharp corners,
- indicator rules cannot be used

Matrix Report (Extended) new in 7.1


In reports of the type Extended, a menu labeled View will automatically be
available on the finished report. This menu contains some display options known from
business support maps, for example to flip axis or join items.
Please note that the new report type, Matrix Report (Extended), is still in an
experimental stage and might not work as expected.

alfabet AG

alfabet Custom Reports 7.1 - Advanced Reporting - Cookbook

Creating a matrix report definition of type Diagram or Affinity


1.
2.
3.
4.
5.

Create a new report


Set Type = Custom
Set Template = MatrixMapReport
Right click report and select Create Custom Report View
Right click report and Start alfabet Report Assistant

The Render Type can be set to Diagram or Affinity Matrix the general options remain
the same.

alfabet AG

17

alfabet Custom Reports 7.1 - Advanced Reporting - Cookbook

Queries attached to the rows and columns define what will be displayed on the X- and Yaxis. A separate query is used to fill the cells, and create a link from the objects to be
displayed in the cells to the objects on the two axis.
Like in other graphical report types, Color Rules and Indicator Rules can be attached to
customize the output some more.

Queries for the rows, columns and cells


Query example for the rows:

Query example for the columns:

alfabet AG

18

alfabet Custom Reports 7.1 - Advanced Reporting - Cookbook

19

Query example for the cells:

Please note that the cell querys show properties have to include both REFSTRs of
the according objects on the X- and the Y-axis, in the first and second position. This is
how planningIT established which objects to place in which cells.
You can see what goes where on the top node of this report in the alfabet Report
Assistance editor. It specifies a Column Ref Index and a Row Ref Index. For
instance, if Column Ref Index = 1 and Row Ref Index = 2, the first REFSTR of the cell
show properties will be matched to the columns (y axis) objects, and the second
REFSTR of the call show properties will be matched to the rows (x-axis) objects.
Creating a matrix report definition of type Extended
1.
2.
3.
4.
5.

Create a new report


Set Type = Custom
Set Template = MatrixMapReport_Ex
Right click report and select Create Custom Report View
Right click report and Start alfabet Report Assistant

From here, proceed as usual; please bear in mind that this report type is still in development.

alfabet AG

alfabet Custom Reports 7.1 - Advanced Reporting - Cookbook

1.9

Lifecycle Reports (Gantt Charts)

Gantt Charts are used to display lifecycle information. The customizable XML based gantt
chart report allows you to select which objects lifecycles you want to display together.

Creating a Gantt Report


1.
2.
3.
4.
5.

Create a new report


Set Type = Custom
Set Template = GanttReport
Right click report and select Create Custom Report View
Right click on the report and Start alfabet Report Assistant

alfabet AG

20

alfabet Custom Reports 7.1 - Advanced Reporting - Cookbook

21

Adding Items to the Gantt Report


In the Report Assistant for Gantt Charts only one type of item can be added (Right click
Add New Item).

The first item will contain the query that finds the objects to be displayed (more information
on this in the next paragraph).
The subordinate items are used to layout the subordinate objects returned by the query
one item per object class. On these items, you can decide how the lifecycle should be
displayed, whether to display the time between start date and end date as a rectangle or line,
and what color it should be. It is easiest to simply put the word Default in the LC Query
field, so the lifecycle will appear exactly the same as in planningIT.

Defining the content of the report


Open the Alfabet Query Builder in the first item attached to the report. Queries can be build
in the same way as displayed in other reports.
The REFSTR has to be included in the Show Properties so that instructions can be used.

alfabet AG

alfabet Custom Reports 7.1 - Advanced Reporting - Cookbook

22

Defining the instructions


Open the Instructions Tab. Several instructions like GroupBy_Ex and RemoveColumns
are required. It also makes sense get several columns together by using JoinColumns for a
better overview in the finished report.

alfabet AG

alfabet Custom Reports 7.1 - Advanced Reporting - Cookbook

23

1.10 Evaluation Reports


Evaluation Reports let you display and edit evaluations. It is one of few editable report types
that you can create in eXpand.

Creating an evaluation report definition


1.
1.
2.
3.
4.

Create a new report


Set Type = Custom
Set Template = EvaluationReport
Right click report and select Create Custom Report View
Right click on the report and Start alfabet Report Assistant

Settings in the report


It is possible to add items with queries to define the content displayed in the report. Also
items to add the Evaluation types can be attached.

alfabet AG

alfabet Custom Reports 7.1 - Advanced Reporting - Cookbook

To see the Evaluation types open of the items and on Evaluation Type. Click on the [...]
button. You can add more than one evaluation type.

Query for the Evaluation Report


To add a query in the Evaluation Report select one of the items and Start alfabet Query
Builder. After building the query its necessary to add GroupBy_Ex instructions.

alfabet AG

24

alfabet Custom Reports 7.1 - Advanced Reporting - Cookbook

1.11 HTML-based Indicator Reports for Object Views


These reports show selected indicators of one object class. If icons have been previously
defined for the indicator, they can be displayed as icons or gauge. They can be included in
object views and displayed with preview.
With eXpand 7.0 the enhanced cockpit designer was released. The cockpits can be
fully customized to display various types of data, including indicators and indicator
icons. That makes this report type largely obsolete.

Creating an HTML-based indicator report definition


1.
2.
3.
4.
5.
6.
7.
8.

Create a new report


Set Type = Custom
Right click report and select Create Custom Report View
Select the report view and click on its center pane
Set Source = Object_Indicators_Html_Report
Set SubType = HtmlView
Open XMLDef
Write or paste report xml definition

alfabet AG

25

alfabet Custom Reports 7.1 - Advanced Reporting - Cookbook

26

Editing the xml


Specify the indicator types whose values should be displayed. Specify whether the value
should be displayed as icon or gauge and the gauge specifications.
<ReportDef
GaugeBackColor="#b50000"
GaugeBorderColor="#d6dfde"
GaugeWidth="10"
GaugeHeight="10"
GaugeSpace="2"
GaugeCount="5">
<Indicator Type="Indicator" Name="MTBF/Max. Mean Time Between Failures"
Caption="MTBF" ReportType="Icon" />
<Indicator Type="Indicator" Name="Standardardization / Status"
Caption="Standardization Status" ReportType="Icon" />
<Indicator Type="Indicator" Name="Metrics / Code Effectiveness" Caption="Code
Effectiveness" ReportType="Gauge" MaxValue="20"/>
<Indicator Type="Indicator" Name="Metrics / Coding/Lines of Code"
Caption="Lines of Code" ReportType="Gauge" MaxValue="20" />
</ReportDef>

1.12 Multi-part Reports (World Map)


Multi-part reports display several slave reports related to a world map master report.
Please note that this report type is still in an experimental stage and might not work
as expected.
The world map master report displays bullets on a world map (based on pixel coordinates)
that link to planningIT object instances.
The bullets displayed contain references to planningIT objects. The selected object serves as
:BASE object for any slave reports in the background.

alfabet AG

alfabet Custom Reports 7.1 - Advanced Reporting - Cookbook

27

Creating a multi-part report definition


The creation process for multi-part reports is still in development. Please copy an existing
mutli-part report from the showcase database and use it as a template for your report.
Editing the xml
Specify the base objects for the slave reports and the coordinates for the bullets representing
these objects.
<?xml version="1.0" encoding="utf-8" ?>
<WorldMap>
<Item Name="Berlin" Hint="Berlin" X="512" Y="123"
Query="SELECT REFSTR,NAME,NULL FROM ORGAUNIT
WHERE NAME = 'Headquarter'" IsSelected="true" />
<Item Name="Moscow" Hint="Moscow" X="602" Y="95"
Query="SELECT REFSTR,NAME,NULL FROM ORGAUNIT
WHERE NAME = 'All Insurance'" />
<Item Name="NewYork" Hint="New York" X="188" Y="169"
Query="SELECT REFSTR,NAME,NULL FROM ORGAUNIT
WHERE NAME = 'Wilmer &amp; Partner Investments'" />
<Item Name="SunFrancisco" Hint="Sun Francisco" X="0" Y="179"
Query="SELECT REFSTR,NAME,NULL FROM ORGAUNIT
WHERE NAME = 'Opti Retail'" />
<Item Name="SouthAfrica" Hint="Johannesbourg" X="556" Y="497"
Query="SELECT REFSTR,NAME,NULL FROM ORGAUNIT
WHERE NAME = 'First Direct'"/>
</WorldMap>

alfabet AG

alfabet Custom Reports 7.1 - Advanced Reporting - Cookbook

28

1.13 Customization Rules


Most graphical reports support one or several types of customization rules. That means that
you can give the objects displayed in the graphical report a different appearance based on
any condition.
The conditions exist in form of additional mini-queries. There are different ways of
implementing rules, and different report types support different types of customization rules.
Type of report /
supports rule type

Color Rule

Tree Map Report


Layer Diagram Report
Lane Report
Grid Report
Cluster Map
Matrix Report (Diagram)
Matrix Report (Affinity)
Matrix Report (Extended)
Gantt (Lifecycle) Report
Evaluation Report
Evaluation Report for
Object Views
Multi-part Report

alfabet AG

Indicator Rule

Size Rule

alfabet Custom Reports 7.1 - Advanced Reporting - Cookbook

29

Rules of type ObjectQuery just return the REFSTR of the object to be colored/sized/etc. You
will need one rule per color/per size/per indicator.
Rules of type ColorQuery/SizeQuery will return a set of colors/sizes (joined together by
using UNION ALL). You will only need one color/size rule per set of colors/sizes. The
advantage of this approach is that you can use parameters inside the SQL statement, which
will allow the end user to select criteria which will be applied dynamically when running the
report.
1.13.1 Color Rules
You can color individual objects on the layer diagram report according to rules that you
specify in form of queries.
1. Right-click on Report Node and select Add new Color Rule
2. Pick a Fore and Back Color for the rule or choose Type = TypeQuery
3. Specify a Query to select the Objects which should be colored
Type = ObjectQuery: The query defined for the color rule returns the REFSTR of the object
that the color shall be applied to. The colors that shall be applied to the object boxes are
defined separately via attributes of the color rule.

Type = ColorQuery: The query defined for the color rule not only returns the REFSTR of
the objects that the color shall be applied to but also the HTML-compliant specification of the
colors to be applied to the object boxes.

alfabet AG

alfabet Custom Reports 7.1 - Advanced Reporting - Cookbook

30

1.13.2 Indicator Rules


You can display a previously configured indicator (in icon form) on the objects of a layer
diagram. This works almost exactly like creating a color rule.
Type = ClassName: The indicator is displayed in the object boxes of all objects of the
object class defined in the attribute Class Name of the indicator rule. The indicator type and
evaluation type of the selected indicator are specified in the attributes Evaluation Type and
Indicator Type of the indicator rule to define the indicator.
Type = ObjectQuery: The indicator is displayed in the object boxes of a subset of objects of
the object class defined in the attribute Class Name of the indicator rule. The query defined
for the indicator rule returns the REFSTR of the objects of the specified class that shall have
an indicator icon displayed in the object box. The indicator type and evaluation type of the
selected indicator are specified in the attributes Evaluation Type and Indicator Type of the
indicator rule to define the indicator.
Type = TypeQuery: The query defined for the indicator rule not only returns the REFSTR of
the objects that the indicator shall be displayed for but also a reference to the indicator (e.G.
for selecting the indicator via filter).
1.13.3 Size Rules
Size rules determine which displayed objects should be of small, medium or large size. The
only report type that supports this right now is the Tree Map Report.
Type = ObjectQuery: The query defined for the size rule returns the REFSTR of the object
that the color shall be applied to. The colors that shall be applied to the object boxes are
defined separately via attributes of the color rule.
Type = SizeQuery: The query defined for the size rule not only returns the REFSTR of the
objects that the color shall be applied to but also the size as specified in the SQL.

alfabet AG

alfabet Custom Reports 7.1 - Advanced Reporting - Cookbook

31

Business Chart Reports (Pie, Line, Bar and Radar Charts)

Business Charts allow you to display report results in pie, line, bar and radar form.

Creating a business chart report


1.
2.
3.
4.
5.

Create a new report


Set Type = Custom
Set Template = BusinessChartReport
Right click report and select Create Custom Report View
Right click on the report and Start alfabet Report Assistant
There will be a default query in the alfabet Report Assistant. This query is predefined
as an example and is always the same for this type of report. You can overwrite it
with your own AQL or SQL query.

alfabet AG

alfabet Custom Reports 7.1 - Advanced Reporting - Cookbook

32

Creating the query


On the tab Data Source Definition, specify your query. You can use native SQL or AQL.
On the tab Data Source Result, you can preview or check your query results in tabular form.

alfabet AG

alfabet Custom Reports 7.1 - Advanced Reporting - Cookbook

33

Working with the alfabet Report Assistant for Business Charts


On the tab Business Graphic Definition,
1.
2.
3.
4.
5.
6.

Check for error messages


Select Business Chart Type
Select x-axis values (in a pie chart, this is the slice labels)
Select y-axis values (in a pie chart, this is the slice sizes)
Fill in titles and pixel dimensions
Select the object to activate a color button in the report and add the possibility to use
links to the specified object while using Silverlight
7. In case of a line chart or bar chart, several series of data can be displayed. In this
case, specify Serie Column(s).
8. In case of a bar chart, you can select either horizontal or vertical orientation for the
bars, and can choose whether the series values should be stacked into one bar, or be
represented by differently colored bars.

alfabet AG

alfabet Custom Reports 7.1 - Advanced Reporting - Cookbook

34

Editable Matrix Reports

There are three kinds of editable Matrix Reports:


Relationship Matrix for direct relationships can be used to edit single or multiple
reference relationships during runtime. This will work for any direct relationship, such as
ResponsibleUser (Reference) or ResponsibleUserGroups
(ReferenceArray), but not if the relationship is specified by a relationship object of its
own class, such as InformationFlow or Role.
Relationship Matrix for indirect relationships can be used to create relationship objects to
implement more compley relationships. These are limited to the following classes:
- BusinessDataUsage
- DemandArch
- PlatformElementDependency
- ProjectArch
- ValueNodeArch
Business Support Matrix can be used to create new business support objects. You can
create new business support objects, but in order to edit them (edit start date, end date, etc.)
you have to navigate to them first using other ways.
Please note that these reports ignore any user rights. They should be made available
only to administrators, not regular users of plannningIT.
3.1

& 3.2

Editable Relationship Matrix for Reference / ReferenceArray

Creating a relationship matrix for any direct relation


1.
2.
3.
4.
5.

Create a new report


Set Type = Custom
Set Template = Relationships_TableReport
Right Click on the report and Create Custom Report View
Right click report and select Start alfabet Report Assistant

alfabet AG

alfabet Custom Reports 7.1 - Advanced Reporting - Cookbook

35

There will be a default query in the alfabet Report Assistant. This query is predefined
as an example and is always the same for this type of report. You can overwrite it
with your own query.

Rows and Columns Definition


Specify queries (native SQL or AQL) to find the rows and the columns of the matrix report.
The Row query will return the object on on side of the relationship, and the Column query will
return the object on the other side.
In the example below, we are aiming for the relationship Application.ResponsibleUser. So
the Row query returns Application objects:
AQL: FIND Application
or SQL: SELECT app.REFSTR FROM APPLICATION app
The Column query returns Person objects:
AQL: FIND Person
or SQL: SELECT usr.REFSTR FROM PERSON user

alfabet AG

alfabet Custom Reports 7.1 - Advanced Reporting - Cookbook

36

Relationship Definition
Now go to the tab Relationship Definition Select Simple Relationship and specify the single
forward reference that is the relationship you want users to be able to edit.

alfabet AG

alfabet Custom Reports 7.1 - Advanced Reporting - Cookbook

3.3

37

Editable Relationship Matrix via Relationship Class new in 7.1

Creating a relationship matrix for an indirect relation


The creation process is the same as for the Editable Relationship Matrix for Reference /
ReferenceArray.
Relationship Definition
In the tab Relationship Definition, select Complex Relationship. Specify the nature of the
complex relationship by selecting the appropriate relationship class from the menu, and set
the Row and Column fields to the respective references from your Row and Column queries.

alfabet AG

alfabet Custom Reports 7.1 - Advanced Reporting - Cookbook

3.4

Editable Relationship Matrix for Business Supports

Creating a matrix for business supports


1.
2.
3.
4.
5.

Create a new report


Set Type = Custom
Set Template = ITMAP_TableReport
Right click report and select Create Custom Report View
Right click report and select Start alfabet Report Assistant

Rows and Columns Definition


This works the same way as in the normal relationship matrix.
Relationship Definition
For the relationship definition, you are given a special screen tailored to the relationships of
business supports.

alfabet AG

38

alfabet Custom Reports 7.1 - Advanced Reporting - Cookbook

alfabet AG

39

alfabet Custom Reports 7.1 - Advanced Reporting - Cookbook

40

Limitations of Native SQL Reports

You can also use native SQL to write planningIT reports. Every single place that allows for
an AQL query will also allow an SQL query (report, wizard post condition, certain xml objects,
etc.).
However, there are some things to keep in mind when writing native SQL queries. In case of
AQL, planningIT automatically takes care of some issues such as making the report
navigatable, validating object mandates, etc. In native SQL, you have to put these features in
manually.

4.1

REFSTR in SELECT

The first argument in the SELECT should be a REFSTR. This tables objects will be
navigatable in the finished report. In AQL this is done by defining one of the classes as the
FIND class.
Example:
SELECT app.REFSTR, app.NAME, app.VERSION
FROM APPLICATION app
ORDER BY app.NAME, app.VERSION

4.2

Examples for JOINS

You can use different tables by joining them together. Like in AQL, you should always use
the REFSTR for this.
Example for JOIN (single reference)
SELECT app.REFSTR, app.NAME, app.VERSION, usr.FIRSTNAME, usr.NAME
FROM APPLICATION app
INNER JOIN PERSON usr ON ( app.RESPONSIBLEUSER = usr.REFSTR)
ORDER BY app.NAME, app.VERSION

Example for JOIN (reference array)


SELECT app.REFSTR, app.NAME, app.VERSION, usrg.NAME
FROM APPLICATION app
INNER JOIN RELATIONS rel ON ( rel.FROMREF = app.REFSTR )
INNER JOIN USERGROUP usrg ON ( rel.TOREF = usrg.REFSTR )
WHERE rel.PROPERTY = 'ResponsibleUserGroups'
ORDER BY app.NAME, app.VERSION

4.3

Filters in SQL reports

While planningIT will initially generate all necessary filters for AQL reports, in SQL reports
you have to put in some manual work to make some filters work, e.g. combo boxes and
checked combo boxes. The showcase database contains example reports with these filter
elements in combination with enumerations, XML objects and subqueries in
* Technical Trainings Report Training II (Advanced) 5. Native SQL Reports

alfabet AG

alfabet Custom Reports 7.1 - Advanced Reporting - Cookbook

41

Please note that you can prefix parameters with NSQL_. This will result in planningIT not
performing any safety checks on this parameter. This will allow you to use parameters from
within constructs like WITH or UNION. However, since there is no safety check, this also
results in error messaged being vague and automatically generated parameter fields
("Create SQL Report View") having to be adjusted manually. new in 7.1
In most cases, a normal parameter (without the prefix) will work fine.
4.4

Cascading Filters new in 7.1

One special case is cascading filters (with a dependency between different filter fields).
Example: you wish to create two filters, and the user will go through two steps: first to select
something in the first filter; this will determine exactly which values the second filter should
offer for selection in the second step. Only afterwards, the Submit button is pressed.
The first filter will be defined as Master Control. On the master control filter,
1. Set a Name (e.g. @USR_REF this reference will be used in the second filters query)
2. Fill the Range with values using a method of your liking (from XML object, from SQL,
from Enum...)
3. Set Submit = True (this will make the filter a Master Control
The second filter will be defined as depending on its master control:
4. Set a Name (e.g. @APP_REF this reference will be used in the results query)
5. Set SubType = SqlEnum and fill the Range with values using SQL (use a condition
to create a connection between this filter and its master control, e.g. WHERE <xyz>
= @USR_REF ).
6. Set Master Controls to include the master control name (e.g. USR_REF) so this
field will be updated when its master control is updated
7. Set Refresh on Submit = true
The results query will use the second filter to filter the result set down, but may also use the
first filter in addition if you want the first filter to be applied to the result set automatically after
the first step already.

4.5

Data Translation

In case one of your locales / culture settings supports the translation of data (such as
application names and descriptions), you may want to display both the contents in the default
language and the second language.
Example:
SELECT
dom.REFSTR,
dom.LEVELID,

alfabet AG

alfabet Custom Reports 7.1 - Advanced Reporting - Cookbook

42

dom.NAME AS "Domain.Name_en",
dom.DESCRIPTION AS "Domain.Description_en",
dom.NAME_1031 AS "Domain.Name_de",
dom.DESCRIPTION_1031 AS "Domain.Description_de"
FROM DOMAIN dom
WHERE ( dom.LEVELID IS NOT NULL AND dom.NAME_1031 IS NOT NULL )
ORDER BY dom.LEVELIDNUM, dom.NAME

4.6

Evaluating Mandates

In AQL queries, the mandate mask is automatically (by design) applied to all objects of the
FIND class, but not to any objects on joined classes. In SQL reports you have the freedom of
applying the mandate mask manually to any table you wish.
By default, mandates are NOT evaluated in SQL queries.
Example:
SELECT
app.REFSTR,
usr.FIRSTNAME + ' ' + usr.NAME AS 'You are:',
app.NAME + ' ' + app.VERSION AS 'You have access to these application
objects:'
FROM APPLICATION app, PERSON usr
WHERE
usr.REFSTR = @CURRENT_USER
AND (bitand(app.MANDATEMASK,usr.MANDATEMASK)<>0)

4.7

Using Instructions in Native SQL Reports

If you would like to use instructions in an SQL based report to create a grouped report, there
is some preparation needed.
The instructions were created to work with AQL / the PlanningIT meta-model so in order for
some of them to work, you have to change your SQL query to look like AQL to planningIT.
Use column aliases to rename your columns to resemble properties from the planningIT
meta-model:
SELECT
NULL,
dom_0.REFSTR AS "Domain_0.REFSTR",
dom_0.NAME AS "Domain_0.Name",
dom_1.REFSTR AS "Domain_1.REFSTR",
dom_1.NAME AS "Domain_1.Name"
FROM DOMAIN dom_0, DOMAIN dom_1
WHERE dom_1.BELONGSTO = dom_0.REFSTR
GROUP BY dom_0.REFSTR, dom_0.NAME, dom_1.REFSTR, dom_1.NAME

Only then, the GROUPBY_EX instruction will work correctly:


GroupBy_Ex("Domain_0.REFSTR","Domain_1.REFSTR","Domain_0",0);
RemoveColumns("Domain_0.REFSTR,Domain_1.REFSTR");

But youre not stuck with the meta-model name for that property / column. Afterwards, you
can set the name to be displayed on the column header by using the SETCOLUMNSHOWNAME
instruction.

alfabet AG

alfabet Custom Reports 7.1 - Advanced Reporting - Cookbook

SetColumnShowName("Domain_0.Name","Domain");
SetColumnShowName("Domain_1.Name","Sub Domain");

Use the instruction SetColumnFormat to change number or date formats.


Examples:
SetColumnFormat("Application.StartDate", "yyyy-MM-dd");
SetColumnFormat("Indicator.Value", "0.00");

alfabet AG

43

S-ar putea să vă placă și