Additional Features
Reports

Building and Maintaining Smart Reports

12min

This functionality is intended to customize reports with the required functionality data, without the need for new updates or additional software.

Before getting started

It is necessary to have access permission.

To use the Designer, it is necessary to define the name of the Schema database from the parameter 32 (eg.: public).

It is necessary to have knowledge in Standard Query Language (SQL) to create or manipulate reports.

Register a Smart Report

  1. Access the functionality through the main menu Reports > Smart Reports > Smart Report;
  2. Click on "New";
  3. Complete the fields for "Register" and "Parameters". Define the type:
  • SQL: create a sub-report "SQL" (this type allows you to create reports that return the database information through a Query). When selecting this option, it is necessary to also inform the type of report to be created, the business rule concerning it, the report designer, the parameter, and the script. This type of report has the following outputs:
    • Template:
  • RhinoScript: to create a report that returns the information of the Database through a "Script", it is necessary to select the type "RhinoScript". It will be necessary to choose the report type, define the parameters and describe the script;
  • JSP: create a report with dynamic content. When opting for this type, you must inform the parameters and the "JSP" script;
  • Builder: create a report of type "Builder". Just link a previously registered "Builder" form.

📌 IMPORTANT!

To create a sub-report (Drill), the "Report Type" should be "Pie Chart" or "Bar Chart".

4. Define the module (functionality), where and to whom the report being created will be displayed:

  • N/A: select this option if you want the report not to be displayed in any module;
  • General: select this option to display the report in one or more modules, where you want the report to be displayed (Configuration, Incidents/Requests, Incidents/Requests (chart), Release, Change, Problem);
  • Specific: select a single module where you want the report to be displayed (Configuration, Incidents/Requests, Incidents/Requests (chart), Release, Change, Problem).

5. Click on "Save";

Build Smart Reports

  • Using Designer:
    1. Select the Tables that will be consulted;
    2. Indicate the Relationships;
    3. Insert filters through the "Parameters" tab;
    4. Set Conditions (only after creating filters);
    5. Add Results;
  • Coding:
    1. Write the SQL/Rhino/JSP content to the corresponding tab;
    2. Insert filters through the "Parameters" tab;

⚠️ Attention!

When using the Designer for report construction, queries are automatically created and are visible in the "SQL" tab. Note that it is not possible to use the Designer and manual insertion of SQL content at the same time.



Using Designer Tool

The Designer tool makes it possible to create SQL reports without the need for coding. See below the items available:

  • Tables: In this area, you must select the tables that will be consulted. To do this, click on "Add", in the "Name" field, type the name of the table and the result will appear automatically. Click on the table(s) and then on "Send". You can remove the table selection by clicking on the checkbox on the left side of the table and then, click on "Remove".
  • Relationships: In this area, you can indicate (if applicable) the relationships between the tables selected in the "Tables" item. To do this, select the first table from the relationship in the "Table" item, indicate a Column from the table, and select a Relationship (INNER JOIN, LEFT JOIN, RIGHT JOIN, or FULL JOIN). Then select the second table from the relationship and indicate the Column. Finally, click on "Add". Here you can also remove the relationship selection by clicking on the checkbox on the left side of the registry and then on "Remove".
  • Conditions: In this area, you can indicate conditions through operators (WHERE, AND, or OR) for data treatment. To do this, select the operator, the table, the comparator, and the value (if applicable), then click on "Add". If needed, remove the condition by clicking on the checkbox on the left side of the table and then on "Remove".
  • Results: In this area, you must indicate which categories of information will be displayed. To do this, select the table and column and click "Add". You can remove the entered value by clicking on the "x" - on the right side of the combination.

Insert Filters through Parameters

Filters can be inserted into a Smart Report to allow the end-user to define scenarios for generating the report. To use a filter, click on the "Parameters" tab and enter the desired filter. Here are a few:

  • In the "Parameters" tab: Parameters
  • Directly in SQL: Parameters in SQL
  • Directly in RhinoScript: Parameters in RhinoScript

Filter to select date

Example

XML


Result

Example use Parameters

Build SQL/Rhino/JSP

Some reports may require specific queries or differentiated treatments. Thus, you can use the code construction area (SQL/RhinoScript/SQL depending on the type of Smart Report selected in the "Registration" tab). In this way, build the query that meets the needs of your report.

  • SQL Example: Example use SQL
  • RhinoScript Example: Example use RhinoScript
  • JSP Example: Example use JSP

Import/Export Smart Reports

You can import a "Report" by clicking on the "Import" button and selecting the file in the ".citreport" format. In addition, you can export existing reports in your instance. To do this, click on "Edit", and at the bottom of the page, click on "Export".

Viewing Interfaces

The created reports can be viewed in different areas of 4biz. See the possibilities:

  • Visualization in Processes, as defined in the "Registration" tab, "Module(s) where it will be displayed" item.
  • Visualization in Dashboards, in this case, only requires linking groups that can use it as a widget in Smart Decisions (Dashboards).
  • Visualization in the Smart Reports area, in this case, after linking groups it can be used in this area.