Basic Report Layout Design

The page layout of reports is organized in sections which stretch over the whole width of the page but may vary in height. In the Stimulsoft Report Designer jargon, these sections are called Bands.
Besides more detailed information, an overview over the Standard Bands is available in the Stimulsoft documentation.

The following example will illustrate the use of these Bands.

If a Band displays a 'Data Source: Not Assigned' message although you already assigned a data source to the Band, run the Lua script on the Report Item object again, e.g. by disabling and re-enabling the Report Item object.

The Report Title Band

The Report Title Band hosts whatever should be shown as the report title. This Band is only be displayed once per report, right at the beginning.

1 Click on the Bands icon to open the menu and select Report Title from the list of options. The cursor changes to a pencil icon and you can click in the report workspace to add the band. or drag and resize the band to the desired size (the band will automatically fill the width of the workspace page).

2 In the Panel Section, select the Dictionary tab and expand the System Variables section. Then drag-and-drop the ReportName item into the ReportTitleBand and adjust the area which can be filled with the value stored in this variable.

3 Click on the Disk(Save) icon in the toolbar to save the current state of the report design.

Always save the Report before making any changes in DataStudio outside the Report Designer Display! Unsaved changes in the report design may be lost when making changes outside the Report Designer Display.

4 In the Properties Panel of the Report Item object, expand the Report section and expand the newly added Report Design Data subsection.

5 For this example, change the Report Name from Report to The Demo Data Report.

6 Click Apply for the Properties Panel to confirm your changes.

The value of the "ReportName" variable (Report by default) is taken from the Report Name property in the Report Design Data section of the Report Item object and can be changed there.

7 Go back to the Report Designer Display and click on the Report Title Band to select it.

8 In the Report Designer’s Panel Section, switch to the Properties tab and adjust the appearance of the text (e.g. font, color etc.) there. Alternatively these adjustments can be made in the toolbar at the top of the Report Designer View. Changes in the toolbar are reflected in the Properties tab and vice versa.

9 Click on the Preview tab to see the current state of the report design. This screenshot shows the Report Name with an increased font size (from the previous step):

To add data which is provided by the Preconfigured Query Options to the report, variables corresponding to these Query Options need to be added to a Data Band. Data Bands are printed as many times as there are rows in the selected data source.

The following sections both provide complete step-by-step instructions how to add Data Bands for Realtime Data and Data Bands for Historical Data. The example for Historical Data will later be used as the basis for the Data Grouping example.

Adding a Data Band for Realtime Data

1 To add a Data Band, first click on the "Bands" icon and select "Data". Then, with the pencil cursor, click in the workspace below the Group Header band to add the data band.

2 From the Data band assignment dialog select the Query Option’s …​_data table as the Data Source for this data band.
For this example, select RT-EX_DD-PD_rt_data.

When selecting the data source, make sure to pick the …​_data table for the Query Option, not the …​_items table!

3 Click OK to assign the data band.

4 To add items to the Data Band, select the Dictionary tab in the Panel Section and expand the Data Sources > ds > RT-EX-DD-PD_rt_data branch.

5 From this branch, drag-and-drop the following items from this branch into the Data Band, placing them from left to right:

  • RT-EX-DD-PD_rt_items > ObjectName

  • RT-EX-DD-PD_rt_items > ObjectDescription

  • Timestamp

  • Value

  • RT-EX-DD-PD_rt_items > OpcEngUnist

  • Data items for data which varies from data set to data set (e.g. Value, Quality, Timestamp) are located in this branch directly.

  • Data items which are the same for a group of data sets (e.g. object properties) are located in a …​_rt_items subfolder.

6 Adjust the width and height of the newly added data fields in the Data Band.

7 Then open the Preview tab. The report should look similar to this:

Adding a Data Band for Historical Data

1 To add a Data Band, first click on the "Bands" icon and select "Data". Then, with the pencil icon, click below the Group Header band in the workspace to add the data band.

2 From the Data band assignment dialog select the Query Option’s …​_data table as the Data Source for this data band - not the …​_items table.
For this example select Hist-EX_DD-PD_ht_data.

3 To specify the sorting of the data, in the options bar on the right side of the dialog select Sort.

4 In the Sort panel, click on Add Sort and in the left drop-down list select Hist-EX-DD-PD_ht_data > Timestamp and select Ascending from the right drop-down list for chronological sorting.

When selecting the data source, make sure to pick the …​_data table for the Query Option, not the …​_items table!

5 Click OK to assign the data band.

6 To add historical data items to the Data Band, select the Dicitionary tab in the Panel Section and expand the Data Sources > ds > Hist-EX-DD-PD_ht_data branch.

7 From this branch, drag-and-drop the following items from this branch into the Data Band, placing them from left to right:

  • Hist-EX-DD-PD_rt_items > ObjectName

  • Hist-EX-DD-PD_rt_items > ObjectDescription

  • Timestamp

  • Value

  • Hist-EX-DD-PD_rt_items > OpcEngUnist

  • Data items for data which varies from data set to data set (e.g. Value, Quality, Timestamp) are located in this branch directly.

  • Data items which are the same for a group of data sets (e.g. object properties) are located in a …​_rt_items subfolder.

8 Adjust the width and height of the newly added data fields in the Data Band.

9 Then open the Preview tab. The report should look similar to this:

In this report the objects are listed in the same order as they were added to the Query Objects table property. For each object the historical data is shown in chronological order - as it occurred.

Data Grouping & Sorting

In the previous examples, the Data Band was printed for all data sets specified in the Report Options, resulting in a long list. To add structure to the report, data can be grouped according to various criteria. A simple first step to improve the Report for Historical Data from the previous section would be to separate the data according to the objects which produced the data.

To do this, we have to add a Group Header Band and a Group Footer Band to the report, enclosing the existing Data Band. On the one hand this pair of bands defines the group, and on the other hand it provides the space for

1 Click on the Bands icon in the Elements bar on the left and select Group Header.
Then, with the pencil cursor, click onto the report page. This will add the Group Header Band at the bottom of the report and open the Group dialog.

2 In the Group dialog select Hist-EX-DD-PD_ht_data > Hist-EX-DD-PD_ht_items > ObjectName. Data will now be grouped and sorted according to the values of the ObjectName fields of the data sets. Keep the Sort Direction property set to Ascending.
Click OK to confirm the grouping criterion and Sort Direction.

3 Drag the Group Header Band into the area between the Report Title Band and the Data Band.

4 Add a Group Footer.

Everything between the Group Header Band and the Group Footer Band is considered to be part of the group.

5 Open the Preview tab. The Report looks a little more structured now:

6 To add more structure to the report drag the ObjectName element and the ObjectDescription element from the Data Source Band into the Group Header Band - as their values are the same for all entries in a group.

But if you look at the last preview very carefully (FC666), you will recognize that not all of the timestamps are in a chronological order.

7 To specify the sorting criteria on Data Band level, first double-click on the Data Band, then click the Sort icon on the right hand side.

8 To add a new sort row, click Add Sort . In this row, select Hist-EX-DD-PD_ht_data > Timestamp as criterion with a double-click. Then select Ascending as the sort direction.

9 With the additional structuring and the sorting configured for the Data Band, the Preview of the Report now looks like this:

Refining Grouping And Sorting With Nested Groups

Building upon the last state of the example report, we can add more structure to the report and add extra sorting levels by nesting groups.

1 To also group and sort data by the Object Description, add another Group Header Band selecting Hist-EX-DD-PD_ht_data > Hist-EX-DD-PD_ht_items > ObjectDescription, leaving the Sort Direction property set to Ascending.
Click OK to confirm the grouping criterion and Sort Direction and close Group dialog.

2 Place this Group Head Band above the existing Group Header Band.

3 Add a corresponding Group Footer Band. This Group Footer Band together with the newly created Group Header Band should now enclose the original group from the previous section.

When nesting groups, make sure to have a Group Header Band together with the corresponding Group Footer Band on the same level, enclosing their contents. Avoid constellations like this '[(])'!

4 Drag the Description element from the original Group Header Band into the new Group Header Band.

5 Move the elements in the Data Band closer to the left border.

6 To add line numbers to the group, go to the Dictionary tab and drag System Variables > Line into Data Band, placing it next to the left border.

7 Move the other elements of the Data group (Timestamp, Value and Engineering Unit) further to the left to remove the gap there.

8 Drag Functions > Totals > Count > Count () : long into the inner Group Footer Band.

9 Right click on the newly added {Count()} element and select Copy.

10 Right click once more and select Paste. The copied element will appear at the mouse pointer. Left click in the outer Group Footer Band to place a second {Count()} element there.

11 Have another look at the Preview. The Report now should look similar to this:

Adding Columns to the DataBand

Using an individual row for each data set leaves a lot of unused space in the report. To use the space more efficiently, we add a second column to the data band, so that two data sets are printed in one line.

1 Click on the DataBand in Report page, then, in the Properties Panel expand the Columns section.

2 Set Columns to 2.

3 Set ColumnWidth to 9,5.

4 Set ColumnGaps to 0.

5 Set ColumnDirection to Across then Down.

Brushing-up the Report

In the final step, colors have been specified and fonts configured. Text fields have been added to the Group Header Bands - e.g. as labels for the resulting columns in the Data Band - but also to provide context information for the results of the {lines()} and the {count()} functions.
Since these edits are made in a similar fashion as in common Office applications, these steps will not be addressed in detail here.

The Final Report

As the reference point for the the following page, with all the styling applied, the final report currently looks like this: