Creating a Grid/Report Application
The Grid application type is used to view, filter, and analyze data in Scriptcase, allowing you to create analytical reports from tables.
With the Grid, you can organize the displayed information and use features such as filters, totals, summaries, charts, pivot tables, data comparisons, and exports in formats such as PDF, Excel, CSV, and XML.
New Application
To create an application in the project, access the Application > New Application menu or use the F2 shortcut screen.
Interface shortcuts can be configured by accessing Settings > My Shortcut Keys.
Click the Grid/Report application card.

Application Data

Connection
This field lists all connections in the project and defines the connection that will be used by the application.
Select the connection to list the database tables.
Connection with Data Dictionary

When the selected connection has a Data Dictionary linked to it, the dictionary name will be displayed below the Connection field.
This information indicates that the connection has a configured dictionary, which can be used to fill in the field labels with lang in the generated applications.
By clicking the dictionary name, a screen will be displayed where you can link new tables to the Data Dictionary. Use this option if the table selected to create the application has not yet been configured in the dictionary.
For more details, access the Data Dictionary documentation.
Name
Defines the name of the application that will be created. This field is required and must contain between 1 and 64 characters.
Alphanumeric characters, period (.), hyphen (-), and underscore (_) are allowed. Spaces and other special characters are not allowed.
Table
Defines the table or tables that will be used as the data source.
It is possible to select more than one table. In this case, Scriptcase builds the relationship between them according to the selection order and the foreign keys identified in the database.
For the relationships to be built correctly, select the tables following the logical sequence of the foreign keys. For example:
customers,orders, andorder_details.
If the selection order does not match the existing relationships, the SELECT command may not be built correctly. After selecting the tables, use the Relationships tab to view the identified links and adjust the structure, if necessary.
Fields
Lists the available fields in the table or tables selected for creating the Grid.
You can select or deselect the fields that will be part of the application. The selected fields will be used to build the initial SELECT command of the Grid.
After creating the application, the fields used in the Grid can be changed in the SQL menu by adding or removing fields from the
SELECTcommand.
Localization
Defines the default language of the application that will be created. By default, Scriptcase selects the Inherit project default language option, making the application automatically use the language defined as default in the project properties.
If necessary, you can select a specific language for the application. In this case, the application will use the selected language, regardless of the default language defined in the project.

After creating the application, the application language can be changed in Application > Settings. If the Inherit project default language option is selected, the language used will be defined by the project’s default language, which can be changed in Project > Properties.
Edit language charset
You can also change the charset used by the language in the application being created. To change the charset, click the edit button displayed next to the language selection field.

When clicking the button, the option to change the charset of the selected language will be displayed.

Note: This change will be applied only to the application being created. The charset defined for the languages in the project settings will not be changed.
SELECT Command
Displays the SELECT command generated after selecting the tables and fields. This field also allows inserting a previously created SQL statement, as long as it uses tables that exist in the database selected in the connection.
SQL Builder
Opens the SQL Builder in a new browser tab.
This resource allows you to build the SQL command in an assisted way by selecting tables, fields, conditions, sorting, and relationships to generate a custom SELECT.
After building the command, it can be incorporated into the SELECT Command field of the Grid.
Recognize foreign keys and create JOINs automatically
Automatically generates the application’s SELECT command using JOINs, based on the foreign keys existing in the selected table.
This resource is available only when using one table to create the Grid. If the selected table does not have foreign keys configured in the database, the
JOINswill not be created automatically.
Additional applications
In the Additional applications tab, you can create other applications together with the main Grid, using the table selected when creating the application as a base.
In addition to creating a Form to edit the records of the main table, Scriptcase can identify related tables through foreign keys and suggest the creation of new Grids and Forms for these tables.
The additional applications created in this step will be linked to the main application through features such as field link or subgrid, depending on the selected configuration.
This feature is available only when using a single table to create the Grid.
Also create a Form to edit the Grid
Allows you to create a Form to edit the records displayed in the main Grid.
When enabling this option, Scriptcase creates the specified Form and automatically configures the link between the applications.

Form name for editing
Defines the name of the Form that will be created to edit the records displayed in the main Grid.

Link open
Defines how the Form application will open to edit the record.
- Open in the same window: Opens the Form application in the same window as the Report application.
- Modal: Opens the Form application in a modal window. The modal width and height can be changed in the link settings.
Create additional applications
Allows you to create Grids and Forms for tables related to the main table, identified through the foreign keys existing in the database.
When enabling this option, Scriptcase displays the relationships found and allows you to configure which applications will be created for each related table. You can also define some basic settings for the applications and the link.

Separate applications by folder
When enabled, the additional applications will be created in separate folders within the project, making it easier to identify and maintain the generated applications.
Relationship
When enabling the Create additional applications option, a list of tables that reference the main table through a foreign key will be displayed. The main table is the one selected in the Application Data tab.
The related tables will be displayed in levels. If they are also referenced by other tables, these secondary tables will also be listed.

In the example above, the demo_customers table was selected as the main Grid table. From it, Scriptcase identifies the tables that reference demo_customers through a foreign key, such as demo_contacts, demo_orders, and demo_sales.
Since the demo_order_details table references demo_orders, this relationship is displayed in a new level within the structure.
Configuration screen

On the configuration screen, each related table can be expanded to define which applications will be created. You can create Grid applications (left column) and Form applications (right column) based on the related table, in addition to configuring how these applications will be linked to the main Grid.
Grid creation settings
- Create Grid - Defines whether a Grid application will be created for the related table. If you do not want to create the application, select the Do not create Grid option.
- The Create Grid for the table option creates a new Grid application based on the related table.
- The Do not create a Grid option does not create or use a Grid application for the related table.
- Name - Defines the name of the Grid application that will be created for the related table. By default, Scriptcase suggests a name based on the selected table, such as
grid_demo_orders. - Link open - Defines how the linked application will be opened when the Navigate option is selected in Link type.
- The Modal option opens the linked application in a window overlaid on the main Grid. The modal size can be changed in the link properties.
- The Open in the same window option opens the linked application in the same window as the main Grid.
- Recognize foreign keys and create JOINs automatically - Automatically generates the
SELECTcommand of the additional application usingJOINs, based on the foreign keys existing in the table.
Form creation settings
- Create Form - Defines whether a Form application will be created for the related table, whether an existing application will be used, or whether no Form application will be created.
- The Create Form for the table option creates a new Form application based on the related table.
- The Use existing form option allows you to use an existing Form application.
- The Do not create/use form option does not create or use a Form application for the related table.
- Name - Defines the name of the Form application that will be created for the related table. By default, Scriptcase suggests a name based on the selected table, such as
form_demo_orders. - Type - Defines the type of Form application that will be created for the related table.
- The Single record option creates a Form to display and edit one record at a time.
- The Multiple records option creates a Form to display and edit several records on a single screen.
- The Editable grid option creates a Form with direct editing of records in grid format.
- The Editable grid (view) option creates a Form in editable grid format based on a view.
Field Editing
This screen displays the fields from the selected tables and allows you to make adjustments before creating the application, such as changing the data type, display name, and other settings.
Note: When additional applications are created, each application will be displayed in its own tab in this step. This allows you to configure the fields of the main Grid, the editing Form, and the additional applications separately.

- Fields - Lists the fields from the table used to create the application.
- Label - Defines the text displayed for the field in the generated applications. When the table is associated with a data dictionary, Scriptcase uses the language variables associated with the fields and displays the translation icon, allowing you to change the text of the lang used in the label.
- Data type - Defines the field data type, such as text, number, date, or other formats used by the application.
- Insert - Defines whether the field will be available to be filled in when inserting new records.
- Update - Defines whether the field will be available for editing when updating records.
The Insert and Update columns are displayed when enabling the Also create a Form to edit the Grid option.
- Grid - Defines whether the field will be displayed in the Grid application.
- Search - Defines whether the field will be available in the application Search.
Relationship
When selecting two or more tables, the “Relationship” tab will be displayed. In this tab, you can view the relationships created between the selected tables.
The relationship will be created and validated automatically, based on the table foreign key configuration.
- OK (Green lines) - The relationship is correct according to the table configuration.
- Error (Red line) - The relationship is incorrect according to the table configuration.
- Saved by user (Yellow lines) - Saved by the user.
This relationship screen is built based on the tables selected in the tables field. If the JOIN is created directly in the SQL field, the tab will not be displayed.
