/

 

The manual

Self-training

Experimentation

Contact

 

Language

The states, the base

Foreword

If you find it difficult to follow the text that follows, you can also consult the following subpage, which describes in detail the sequence of operations to be carried out to build the first report described in this document:

Click-by-click description of how to build the state described below

The set of cards that serves as an example

For this part, we are going to use our simplified invoice form, and create 3:

Bill

Date : 2016-03-12

Client : Jean Martin

Item

Amount

Unit price

Price

 

Joint

2

2.05

4.10

Tube

1

120.00

120.00

 

Total:

124.10

 

Bill

Date : 2016-03-15

Client : Jean Martin

Item

Amount

Unit price

Price

 

Vis

5

0.10

0.50

Transformateur

1

50.00

50.00

Moteur

1

300.00

300.00

 

Total:

350.50

 

Bill

Date : 2016-04-17

Client : SA Lebrun

Item

Amount

Unit price

Price

 

Joint

3

2.05

6.15

Tube

2

120.00

240.00

 

Total:

246.15

 

The first state

From there, we can create a report that lists the invoices:

Date Client Nombre d'items
Les états 2016-03-12 Jean Martin 3
Les états 2016-03-15 Jean Martin 7
Les états 2016-04-17 SA Lebrun 5

Its construction, step by step

Let's start by creating the status block (see icon opposite).

For information, here is the contextual menu of a report block, which allows us to view the different categories of information to be entered.

Step 1: the 'Spec. collection'

They allow you to specify where and what.

For this first very simple example, only the first two parts interest us.

The 'Root of the tree structure to scan' table specifies the pages of the site from which the files will be searched, by going down recursively in all the sub pages.
To insert a page, we go there, then in edit mode we click on the icon opposite to place its address in the clipboard, finally we click on the button 'Add a tree structure of pages to scan' to enter the status.

Then we fill in the 'Form type' table.
In our example, the type that was chosen when designing our simplified invoice sheets is 'invoice'.

Step 2: the 'Fields' parameters

They specify the list of fields (columns) of the report. In our example, we get:

For each control that defines a report column:
'Label' is free,
'Variable name' corresponds to the code of the column that will be used in the programs.
'Collection mode' \u003d 'Variable name' is the type of column. What is displayed in the column is the value of the form field which bears the name indicated in 'Variable name'.
In this case, 'Type' must therefore correspond to the type of the control in the form.

Below is the definition of a column obtained by calculation:

The calculation is performed on collection, which means that the calculation formula can use all the fields of the collected record.
By contrast, a formula calculated on display can only use the other columns of the report, as well as possibly the previous rows.

Step 3: the 'Display' parameters

These parameters define:

Filter: which lines of the report are displayed

Group: display a single line

Sort: defined in which order we must display the lines

In our example, only the order is specified, namely according to the ascending order of the 'Date' column.

Filter and group will be seen in our second example.

Step 4: activate the state

A level of 'Collection', select 'Browse the forms'

Note: when you change the fields of a report, add or remove parameter input fields (see below) you may need to ask 'Collect' 'Rebuild' then 'Collect' 'Browse the forms' so that the data update themselves.

A second state, with filtering parameters

Here is our second report, which lists all the orders for a given part, between two dates.

Code article : Joint

Du : 2016-01-01

au : 2016-12-31

Code article Date Quantité
Les états Joint 2016-03-12 2
Les états Joint 2016-04-17 3
5

Its construction

Let's start by observing it in 'Organize' mode with the 'Detailed' option to see the blocks that compensate for it:

We see that we no longer have a single 'State' block, but a series of blocks. Here an input field 'filter_code' followed by a table containing two cells, with in the first an input field 'from' and in the second an input field 'to'.
These three input fields which have been added will be used to make the display of the report configurable. See the filtering formula a little further.

For this, let's see the three series of parameters which, as previously, were used to define the state:

We note first of all that in the new report, we do not have one line per file, but one line per line of the 'article' sub-table of each file. This is specified by the parameter 'Name of the field to use to find the different lines'

Then, we have a row filtering formula which is:

(code contains filtre_code) and date>=du and date<=au

and which is read, only the lines for which the code column contains what is specified in the parameter field 'filter_code' that we added at the head of the report, and for which the date is between that indicated in the field parameter 'from' and the one indicated in the parameter 'to' field.

A third state, with groupage

We are going to illustrate the line grouping function via a third report which lists, for each item, the quantity ordered between the two dates specified in parameter:

Du : 2016-01-01

au : 2016-12-31

Code article Quantité
Les états Joint 5
Les états Moteur 1
Les états Transformateur 1
Les états Tube 3
Les états Vis 5
15

At the parameters' Spec. collection ', nothing changes.

At the level of the definition of the fields, we now have:

The small change is that the column 'date' is now hidden, since it is only used to filter the lines, and that we only want one line per item, corresponding to the total of orders on the given period.
Then, the definition of the column 'quantity' is unchanged, but since its type is a number, by default, we display the sum of the values \u200b\u200bfor the grouped rows. We could have indicated 'Sum' at the level of 'Grouping mode' to remove any ambiguity.

The main change is in the display parameters:

We have filled in the 'Group the lines' part to specify that we only want one line displayed for all the collected lines corresponding to a single item.

Note: the sorting formula must be compatible with the grouping requested, ie ensure that all the lines to be grouped are found consecutively after sorting.

Balance sheet

What we have just illustrated is that a Storga report is a sort of parametric query, which allows on the one hand to find all the records corresponding to certain criteria, to sort them, and on the other hand to perform consolidations via the grouping function.

In a logic of using Storga to optimize the activities of the company, the reports are the main tool to allow everyone to access specifically the information that concerns them, in particular what they have to do, and set up reporting and automatic indicators.

Go further

There is a second article outlining the advanced aspects of states:

States, advanced functions

and another explaining how to programmatically access the data contained in the reports:

The 'lookup' and 'report' functions
      

To complete

Fields by user

Illustrate the interest of the link to the files

Cumulative field

Provide an example of using the selection column

The views