Low-code designer > Report / Report customization example

Report customization example

As an example, consider the Contract, Order, and Invoice apps.

The apps are filled with data according to the following principle: when creating an order, a contract, and a client are specified. After the agreement of the contract, an invoice is added to its page. Several invoices can be issued for one contract.

Let’s display the data from these apps in the Order Register report. The report table for each order will show the ordering company, the name of the contract, and the sum of all invoices issued under a certain contract.

cust_report_01

To customize the report in this way, follow these steps:

  1. Open the report page and go to the source settings.
  2. Click + Data Source and add three apps from different workspaces of the system: Contract, Order, and Invoice.

cust_report_02

  1. Add columns to the table by selecting fields from the sources. At the same time, change the default code of each column so that they do not overlap with each other. This is necessary for exporting data from the report.
  • Orders. Name and Contractor fields.
  • Contracts. Name field.
  • Invoices. The Amount field with the Aggregation > Amount option. Using the aggregation option, the table will display not the value specified in the card of each invoice, but the sum of all invoices issued under one contract.
  1. Bind the sources to each other.

In our example, the report sources are linked by two data aggregation conditions. Let’s consider each of them in detail.

Linking sources by a common field

Let’s create a bind between the sources Order and Contract so that the table displays the amount for each order.

When creating an order and a contract, the contract concluded with the customer is specified. It is this property that will be the unifying field for linking the sources in the report.

  1. Make sure that the Order field with the Number type has been created on the Contracts and Invoices app forms. Enable the search and sort option for it in the form settings of each source.
  2. On the report source settings page, click Bind Data Sources.
  3. Fill in the data in the binding settings:
  • Specify the first and second sources: Orders and Contracts apps;
  • Select the field for binding: Index Number;
  • Set the binding type: Ignore all empty cells. The table will contain only those orders that have a contract and a certain invoice linked to it.

rep_cust2

In our example, let’s consider the result of data merging when selecting other types of binding:

  • Ignore empty cells on the left. The table will display only orders with the Order field filled in, as well as all records from the Invoices app, even if no contract is specified in the invoice.
  • Ignore empty cells on the right. The table will display all added orders, even if no contract is specified for them. In this case, the invoices will be shown only with the contract bound to them.
  • Full. All records from the Orders and Invoices apps will be displayed in the table.
  1. Save the created binding.

Bind sources by string-app fields

Add a binding between the Contract and Order sources to sort the data in the table by an additional condition and display a specific contract and the sum of its invoices.

The Order and Contract sources do not have the same common field added for binding. In this case, the apps can be linked in a different way.

начало внимание

If on the form of source A, there is a field of type App referring to source B, the binding can be configured by this field and the system property String of source B.

конец внимание

Let’s take a closer look at how sources are combined in such settings. Each app item has a unique code. It is assigned when the item is created and is stored in the String system field. When an application B record is specified in the application A item page, these items are bound together. For more information, see Create an app item on the page of another app.

When generating a report, matches between the records of two sources are identified. The identifier for the app A item will be used to find the app B item specified on its page. In the report table, the related records will be displayed.

In our example, when creating an invoice, the contract concluded with the client is selected in the App type field on its form. You can customize the binding as follows:

  1. Ensure that a Contract field with the App type is created on the Contract app form and that the search and sort option is enabled for it. For the system field String, the option is enabled by default.
  2. On the report source settings page, click the Bind Data Sources button.
  3. Fill in the data in the binding settings:
  • Specify the first and second sources: Order and Contract apps;
  • Select the field for binding. For the Order source specify the App field, for the Contract appѕ, the Identifier field;
  • Set the binding type: Ignore all empty cells.

report_cust

  1. Save the created binding.
  1. After creating links between sources in the advanced settings you can set the order of displaying columns in the table and set the time of data refresh.

The Source Settings page with the set parameters will look as follows:

cust_report_03

  1. The result of combining the Order, Contract, and Invoice apps by two conditions will be displayed in the report table.

Search and sort records in the report

The filter is created automatically from the property of the source app added as a table column.  The property must have the search and sort option enabled in the source form settings, or data aggregation must be enabled for the column.

Specify the parameter values and click Search to find the corresponding records.In addition, you can sort the data in the columns, for example, by increasing the amount by account. To do this, click on the column name in the table.

cr5

Found a typo? Highlight the text, press ctrl + enter and notify us