Eva Klein's picture

The WYSIWYG editor is a practical means of creating reports. In my last article, I explained the difference between using the WYSIWYG editor to create a script and directly programming it using JavaScript code. In this article, I focus on the overall structure of WYSIWYG editor.

In the WYSIWYG editor you can define the content and layout of your reports based on report script templates. The templates provide sections and subsections, headers and footers, and an optional cover page. You can add various elements to these structural elements, such as queries, data fields, data tables, text boxes, formatting tables, text, images, charts, or hyperlinks. Formatting tables are available that you can use to place and arrange the relevant elements in sections and lines.

Report script templates provide a schematic representation of the report's content and layout, with individual placeholders being inserted for query components such as data fields, data tables or charts. When the report script is run, the corresponding data is inserted and later displayed in the final report.

Example: Structure of a report script template

The WYSIWYG editor is structured into two columns. The 'Structure' column on the left shows the hierarchical structure of queries. The 'Content' column on the right contains the display and layout components that were inserted.

The basic structural elements of report script templates are called 'sections'. In these sections the data to be evaluated is defined by means of queries, and layout components such as headings or images are inserted.

Example: Section
In a section you can define that only the EPCs of a selected group are queried. The data of these EPCs then serves as the basis for other queries, for example, a query returning all functions of the relevant EPCs or their names.

When creating a report, you first select the context (e.g., groups or models) and thus define the database items for which a report can be run. For each selected context, a corresponding section is automatically created on the highest level of the report structure, into which queries can be inserted subsequently.

Example: Context
If 'Database' was defined as the context of the section on the highest level of the structure, you can run the report for selected databases. If a second section has 'Group' as its context, it is possible to run the report also for selected groups. If the report is run directly for a group, no queries are run for a database.

Repetition area and static area
A section consists of a repetition area (highlighted in dark beige in the screenshot above) and two static areas (highlighted in light beige). The static areas are positioned above and below the repetition area. If no data is available for the section's repetition area, only one static area is displayed. You can insert any required content in the individual areas. The contents of static areas is output only once when report script templates are run, while the content of a repetition area is output as many times as a query returns data elements.

Example: Query in the static area
In the static area, you can display the name of a database. The name is displayed in the report once.

Example: Query in the repetition area
In the repetition area, you can query all functions of multiple EPCs. The report outputs the function names individually.

Subsections serve to supplement and nest queries.

Example: Nesting queries
The context of a section on the highest level of the report structure specifies that the query can be run for selected groups. In a section that is inserted, only EPCs of selected groups are queried. In another subsection, all functions of EPCs contained in selected groups are queried. Furthermore, the names of the functions are output using a data field. The report lists all names of the queried functions for each EPC of a group.

Levels of the report structure
A report script template can contain any required number of sections. A section or subsection can contain as many subsections on the same level as you need. In the report structure you can define a maximum of six levels. Within a section, subsections are indented.

Headers and footers
On the report pages, content can be displayed in headers and footers. Sections can also have their own headers and footers, which then replace headers and footers of the report pages. It is not possible to insert queries in a header or footer. In the report definition, headers and footers of a page are highlighted in gray.


Creating a report using the WYSIWYG editor is therefore just a matter of filling the different sections and sub-sections with the required data. In my next article, I will walk through a simple example report.

Tags: ARIS Report tutorial