Documente Academic
Documente Profesional
Documente Cultură
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
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
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 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.
alfabet AG
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
1.2
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 AG
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
1.3
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 AG
10
11
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
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
1.4
& 1.5
13
alfabet AG
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
15
It is possible to add Color Rules and Indicator Rules. The creation process is the same as
in Tree Map Reports.
alfabet AG
1.6
16
Matrix Reports
alfabet AG
The Render Type can be set to Diagram or Affinity Matrix the general options remain
the same.
alfabet AG
17
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.
alfabet AG
18
19
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.
From here, proceed as usual; please bear in mind that this report type is still in development.
alfabet AG
1.9
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.
alfabet AG
20
21
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.
alfabet AG
22
alfabet AG
23
alfabet AG
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.
alfabet AG
24
alfabet AG
25
26
alfabet AG
27
alfabet AG
28
Color Rule
alfabet AG
Indicator Rule
Size Rule
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
30
alfabet AG
31
Business Charts allow you to display report results in pie, line, bar and radar form.
alfabet AG
32
alfabet AG
33
alfabet AG
34
& 3.2
alfabet AG
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.
alfabet AG
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
3.3
37
alfabet AG
3.4
alfabet AG
38
alfabet AG
39
40
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
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
4.3
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
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
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
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
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
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
SetColumnShowName("Domain_0.Name","Domain");
SetColumnShowName("Domain_1.Name","Sub Domain");
alfabet AG
43