Group By
Group By Settings
These are the general settings of the “Group By” in the Grid, independently of it’s type, static or dynamic. Here we can define some Group By viewing options, such as the use of Tree view, for example.
The option Enable TreeView isn’t available in the Infinite Scroll.
- Enable TreeView : Defines the use of TreeView in “Group By”, which allows you to expand or collapse the records displayed in Group by.
- Group By Line : Sets the positioning of group by in relation to group records. The options are Before the records or After the records.
- Group By Header : Lets you display the Group By header on all pages.
- Group By sorting : It allows to order the fields respecting the Group By.
- Display Titles : Allows the label display of the fields within the groups.
- Record count title : Sets a title for the records quantity column.
- Value Separator : Define the separator between the title and the field value in the GROUP BY.
- Tab a Group By : Sets the left margin of Group By. The value must be informed in pixel.
- Separates the Group By : Sets the spacing between two Group By. The value must be informed in pixel.
Dynamic Group By
In this screen we define the fields available in Dynamic Group By and will be summarized in Grid and Summary when the Dynamic Group By is used.
Select Fields
In this screen we define the fields available in the Dynamic Group By and will be summed in the Grid and Summary when the dynamic Group By is used.
This Group By works independently from any other Group By configuration or Totals already performed, that is, the fields defined to be summarized in the Grid or Summary in the Dynamic Group will be visible only when the Dynamic Group is used.
We will be able to see all available fields for the Group By configuration and totals in the Grid Fields.
The Use Dynamic Group By option enables the Group By in the run-time application.
Fields used when using the Grid must be configured to be displayed on the Grid.
- Grid Fields: List of all the fields of the application.
- Group By Fields: Defines the fields that are part of the Group By.
- Grid Totals: Defines the fields that are part of the Grid Totals.
- Summary Totals: Defines the fields that are part of the Summary Totals.
Group By Fields
We must drag and drop the fields that will be part of the Group By in Group By Fields.
Each field can only be added once to the Group By Fields, except for the date and datetime fields.
Date and Datetime fields
For date and datetime fields, some display intervals have been added, so these fields can be added two or more times to the Group By.
All Grid fields can be added to the “totals”, the only difference being the functions available. Numeric fields can use all the available summarization functions, since the non-numeric fields can use only the count and the different count.
The fields configured in this totals can be edited in Grid > Totals > Fields > Dynamic Group By
Summary Totals
The fields added to the Summary totals will only be visible in Summary at the time Dynamic Group By is used.
All Grid fields can be added to the “totals”, the only difference being the functions available. Numeric fields can use all the available summarization functions, since the non-numeric fields can use only the count and the different count.
The fields configured in this totals can be edited in Summary > Fields > Dynamic Group By
Fields
The fields added to the Grid Fields will be listed within the Fields folder so that they can be edited individually.
General Settings
Categories: Text and Barcode
- Data Type: Defines the data type of the field in the HTML.
- Group by label: Defines a label of the fields displayed in the Group By.
- Case Settings: Converts the text according to the selected option.
- Upper Case: Transforms the text in upper case.
- Lower Case: Transforms the text in lower case.
- Capitalize first word: It transforms the first word in the upper case or lower case, according to the text retrieved, that is, if the text retrieved by the application is in lower case, this option will make upper case only the first word.
- Capitalize all words: Transforms all words in the upper case or lower case, according to the text retrieved, that is, if the text retrieved by the application is in lower case, this option will transform upper case into all words.
- Field Mask: On this field you will configure the display mask according to the table informed in Applications > Grid > Fields > Text.
- SQL Type: Informs the data type of the field in the database.
Categories: Number and Calculated
- Data Type: Defines the data type of the field in the HTML.
- Group by label: Defines a label of the fields displayed in the Group By.
- Field Mask: On this field you will configure the display mask according to the table informed in Applications > Grid > Fields > Text.
- SQL Type: Informs the data type of the field in the database.
Categories: Special and Date/Time
- Data Type: Defines the data type of the field in the HTML.
- Group by label: Defines a label of the fields displayed in the Group By.
- SQL Type: Informs the data type of the field in the database.
Lookup Settings
This option is available in the fields of the categories: Text, Number, Calculated, Special and Barcode.
On this option, it’s possible to setup the display lookup for the fields cited above.
Three lookup methods are available.
-
Automatic - SQL must be assembled to display the desired information. You can build a sql using the Create select option.
-
Manual - The values that will be displayed in the application are informed in the interface. The value to be displayed (Label) and the corresponding value to the database (Value) must be informed.
-
Inherit from Grid - Inherits the lookup setting configured in this field, in the field options of the grid application.
For more information about using the Grid Lookup, access Application > Grid > Fields > Text.
Values Format
Number Type
- Regional Settings: When active, you can apply the Regional Settings to this field. To modify the setting, access Locales > Regional Settings in the Scriptcase Menu.
- Color of Negative: In this field you’ll inform the color value in hexadecimal. (Example: #000000)
Currency Type
- Regional Settings: When active, you can apply the Regional Settings to this field. To modify the setting, access Locales > Regional Settings in the Scriptcase Menu.
- Currency Symbol: When this option is activated, the application will display the currency symbol according to the Regional Settings.
- Color of Negative: In this field you’ll inform the color value in hexadecimal. (Example: #000000)
- Decimal Precision: Amount of decimal that your field will be displaying.
- Complete with Zeros: Activating this option will allow the application to complete the value after the coma with zeros.
Date Type
- Regional Settings: When active, you can apply the Regional Settings to this field. To modify the setting, access Locales > Regional Settings in the Scriptcase Menu.
- Display: In this field you will select how will the field will display itself.
Group By Settings
- Attributes
- Field Position : Defines how the information contained in the Group By line will be displayed and organized.
- Columns : Defines the amount of columns information contained in the Group By line will displayed and organized.
- Display Label : Defines if the field label will be displayed.
- Line break : Displays or not the Group By line with the value divided in another line.
- Records amount : Defines whether the Group By row will display the number of group records.
- Break PDF Page (Grid) : Defines if the PDF file, generated by the GRID, will contain each group by printed in a new page.
- Ex. In a report you can have some orders where they can be displayed on different pages.
- Break PDF Page (Summary) : Defines if the Summary PDF file, generated by the GRID will contain each Group By printed in a new page.
- Ex. In a report you can have some orders where they can be displayed on different pages. .
- Break HTML Page (Grid) : Displays each Grid Group By in a different HTML page.
- Break HTML Page (Summary) : Displays each Summary Group By in a different HTML page.
- Start TreeView : Defines the initial state of the TreeView.
- Sorting : If this option is set to “Yes”, the selected fields will sorted without the need to be clicked on, the sorting will be done respecting the criteria of the Group By.
- Fields : Defines which fields are going to displayed in the Group By row. It’s also possible to define if it’s going to be displayed in the Totals or in the Summary of this field by selecting Value or Sum, before clicking on the button “On/Off”.
Group By Line Layout (Label)
Layout configuration of the Group By Label.
- Attributes
- Font Style : Defines the font that’s going to be used in the Label.
- Font Size : Defines the size of the font used in the Group By Label.
- Font Color : Font color for the Group By Label.
- Background Color : Group By background Color.
- Bold Text : Defines if the label will have a Bold Text.
Group By Line Layout (Value)
Layout configuration of the Group By Value.
- Attributes
- Font Style : Defines the font that is going to be used in the Value.
- Font Size : Defines the size of the font used in the Group By Value.
- Font Color : Font color for the Group By Value.
- Bold Text : Defines if the value will have a Bold Text.
Static Group By
This type of Group By is configured by the developer, where the end user can select one of the predefined Group By available in the application.
Settings
These configurations affects the Static Group By.
Static Group By Settings
- Use empty Group By: Configuration used when you want the Grid to be initialized without any Group By.
- Title of the empty Group By: Defines a title for the empty Group By option. (Available only when the previous option is enabled)
- Initial Group By: Defines the Group By used when running the generated application.
Sorting Groups Settings
Defines the order that the Group By’s will be displayed in the Grid.
New Group By
Interface to create the static Group By.
- Name: Defines the internal name of the Group By, used by ScriptCase.
-
Label: Defines the displayed name of the Group By, that will be displayed in the application.
- Grid Fields: List of all the fields of the application.
- Group By Fields: Defines the fields that are part of the Group By.
- Grid Totals: Defines the fields that are part of the Grid Totals.
- Summary Totals: Defines the fields that are part of the Summary Totals.
Group By Fields
You need to drag and drop the fields that’ll be part of the Group By in the Group By Fields.
Each field can only be added once to the Group By Fields, except for the date and datetime fields.
Date and Datetime fields
For date and datetime fields, some display intervals have been added, so these fields can be added two or more times to the Group By.
Grid Totals
The fields added in this total will be visible only in the Grid (if the total field is visible in the Grid) at the time that the group by is used.
All Grid fields can be added to the “totals”, the only difference being the functions available. Numeric fields can use all the available summarization functions, since the non-numeric fields can use only the count and the different count.
The fields configured in this totals can be edited in Grid > Totals > Fields > Dynamic Group By
Summary Totals
The fields added to the Summary totals will only be visible in Summary at the time Dynamic Group By is used.
All Grid fields can be added to the “totals”, the only difference being the functions available. Numeric fields can use all the available summarization functions, since the non-numeric fields can use only the count and the different count.
The fields configured in this totals can be edited in Summary > Fields > Dynamic Group By
Edit Group By
After the creation steps, all the Group By will be listed in the Static Group By folder, below the Settings item.
Expanding the Group By Folder, you will see the settings icon, where you can edit the entire Group By.
You can also view the fields used in the Group By, that can be edited independently from the Grid Layout, see the following:
Fields
The fields added to the Grid Fields will be listed within the Fields folder so that they can be edited individually.
General Settings
Categories: Text and Barcode
- Data Type: Defines the data type of the field in the HTML.
- Group by label: Defines a label of the fields displayed in the Group By.
- Case Settings: Converts the text according to the selected option.
- Upper Case: Transforms the text in upper case.
- Lower Case: Transforms the text in lower case.
- Capitalize first word: It transforms the first word in the upper case or lower case, according to the text retrieved, that is, if the text retrieved by the application is in lower case, this option will make upper case only the first word.
- Capitalize all words: Transforms all words in the upper case or lower case, according to the text retrieved, that is, if the text retrieved by the application is in lower case, this option will transform upper case into all words.
- Field Mask: On this field you will configure the display mask according to the table informed in Applications > Grid > Fields > Text.
- SQL Type: Informs the data type of the field in the database.
Categories: Number and Calculated
- Data Type: Defines the data type of the field in the HTML.
- Group by label: Defines a label of the fields displayed in the Group By.
- Field Mask: On this field you will configure the display mask according to the table informed in Applications > Grid > Fields > Text.
- SQL Type: Informs the data type of the field in the database.
Categories: Special and Date/Time
- Data Type: Defines the data type of the field in the HTML.
- Group by label: Defines a label of the fields displayed in the Group By.
- SQL Type: Informs the data type of the field in the database.
Lookup Settings
This option is available in the fields of the categories: Text, Number, Calculated, Special and Barcode.
On this option, it’s possible to setup the display lookup for the fields cited above.
Three lookup methods are available.
-
Automatic - SQL must be assembled to display the desired information. You can build a sql using the Create select option.
-
Manual - The values that will be displayed in the application are informed in the interface. The value to be displayed (Label) and the corresponding value to the database (Value) must be informed.
-
Inherit from Grid - Inherits the lookup setting configured in this field, in the field options of the grid application.
For more information about using the Grid Lookup, access Application > Grid > Fields > Text.
Values Format
Number Type
- Regional Settings: When active, you can apply the Regional Settings to this field. To modify the setting, access Locales > Regional Settings in the Scriptcase Menu.
- Color of Negative: In this field you’ll inform the color value in hexadecimal. (Example: #000000)
Currency Type
- Regional Settings: When active, you can apply the Regional Settings to this field. To modify the setting, access Locales > Regional Settings in the Scriptcase Menu.
- Currency Symbol: When this option is activated, the application will display the currency symbol according to the Regional Settings.
- Color of Negative: In this field you’ll inform the color value in hexadecimal. (Example: #000000)
- Decimal Precision: Amount of decimal that your field will be displaying.
- Complete with Zeros: Activating this option will allow the application to complete the value after the coma with zeros.
Date Type
- Regional Settings: When active, you can apply the Regional Settings to this field. To modify the setting, access Locales > Regional Settings in the Scriptcase Menu.
- Display: In this field you will select how will the field will display itself.
Group By Settings
- Attributes
- Field Position : Defines how the information contained in the Group By line will be displayed and organized.
- Columns : Defines the amount of columns information contained in the Group By line will displayed and organized.
- Display Label : Defines if the field label will be displayed.
- Line break : Displays or not the Group By line with the value divided in another line.
- Records amount : Defines whether the Group By row will display the number of group records.
- Break PDF Page (Grid) : Defines if the PDF file, generated by the GRID, will contain each group by printed in a new page.
- Ex. In a report you can have some orders where they can be displayed on different pages.
- Break PDF Page (Summary) : Defines if the Summary PDF file, generated by the GRID will contain each Group By printed in a new page.
- Ex. In a report you can have some orders where they can be displayed on different pages. .
- Break HTML Page (Grid) : Displays each Grid Group By in a different HTML page.
- Break HTML Page (Summary) : Displays each Summary Group By in a different HTML page.
- Start TreeView : Defines the initial state of the TreeView.
- Sorting : If this option is set to “Yes”, the selected fields will sorted without the need to be clicked on, the sorting will be done respecting the criteria of the Group By.
- Fields : Defines which fields are going to displayed in the Group By row. It’s also possible to define if it’s going to be displayed in the Totals or in the Summary of this field by selecting Value or Sum, before clicking on the button “On/Off”.
Group By Line Layout (Label)
Layout configuration of the Group By Label.
- Attributes
- Font Style : Defines the font that’s going to be used in the Label.
- Font Size : Defines the size of the font used in the Group By Label.
- Font Color : Font color for the Group By Label.
- Background Color : Group By background Color.
- Bold Text : Defines if the label will have a Bold Text.
Group By Line Layout (Value)
Layout configuration of the Group By Value.
- Attributes
- Font Style : Defines the font that is going to be used in the Value.
- Font Size : Defines the size of the font used in the Group By Value.
- Font Color : Font color for the Group By Value.
- Bold Text : Defines if the value will have a Bold Text.
Events
These events are only available for static Group By.
The OnGroupByAll event occurs after running the Group By, that allows you to manipulate the totals variables.
Total variables are created based on the fields selected for group by and totals.
The following is an example of the available variables:
Assuming that an application has a Group By state and city and two summarization per parcel and balance, the following summarization variables are available:
Variables | Description |
---|---|
{count_ger} | Contains the total number of records. |
{sum_parcel} | Contains the general sum of the parcel field. |
{sum_balance} | Contains the overall sum of the balance field. |
{count_state} | Contains the total amount of records, from the state group by being processed. |
{sum_parcel_state} | Contains the general sum of the ‘state’ field and the ‘parcel’ field that are being processed. |
{sum_balance_state} | Contains the general sum of the ‘balance’ field and the ‘parcel’ field that are being processed. |
{count_city} | Contains the total number of records, of the city group by being processed. |
{sum_parcel_city} | Contains the general sum of the ‘parcel’ and ‘city’ field that are being processed. |
{sum_balance_city} | Contains the general sum of the ‘balance’ and ‘city’ fields that are being processed. |
To access the summarization variables by group, simply replace the Group By name with Group By. Example: {sum_balance_city} for {sum_quebra_balance}
Variables | Description |
---|---|
{count_quebra} | The total number of records in the Group By that is being processed. |
{sum_quebra_parcel} | Contains the general sum of the parcel field, of the Group By that is being processed. |
{sum_quebra_balance} | Contains the sum total of the balance field, of Group By that is being processed. |
Example:
In an application that has Group By by state and city and totals a balance field in Group By totals, we want to display the average in place of the balance. A method is created in the OnGroupByAll event, with the following content:
{sum_quebra_balance} = {sum_quebra_balance} / {count_quebra};