1 Introduction

 

1.1 What is it?

SQL-Matrix is an Axional Studio Form Component used to display data in a structured format. It can contains words, numbers, checkbox, combobox. This component has been built with Material design styles with light and dark themes.

 

1.2 What can I do?

Basically, SQL-Matrix allows you:

  • Display more compact data than a table.
  • Accept two or three dimensions.
  • Customize the columns, rows and selector labels.
  • Put cell styles.
  • Do surveys.
 

1.3 What do I need?

SQL-Matrix requires an Axional Studio Form Object to be put in.

 

2 Architecture

wic_jrep_box_sqlmatrix
Label Description
box_id

  • Default: THIS
Rows Column of y axis data
Rows description Column label of y axis data.
Columns Column of x axis data
Columns description Column label of x axis data
Selector Column of z axis data
Selector description Column label of z axis data
Values Column of matrix data
Initial filter Initial filter
sqlstmt

user_created

  • Default: USER
date_created

  • Default: CURRENT
user_updated

  • Default: USER
date_updated

  • Default: CURRENT
                                

Structure

Loading...
wic_jrep_box_celldata_auth
Label Description
box_id
Insert If can Insert

  • Default: 0
  • Values:
    • 1: Yes.
    • 0: No.
Delete Grant to delete

  • Default: 0
  • Values:
    • 1: Yes.
    • 0: No.
Update Role to update

  • Default: 0
  • Values:
    • 1: Yes.
    • 0: No.
Expression/SQL Expression to evaluate to prohibit an authorization.

Reason Reason by which prohibe the authorization

User created User that has created the object

  • Default: USER
Date created Creation date

  • Default: CURRENT
User updated User updated

  • Default: USER
Date updated Updated date

  • Default: CURRENT
 

3 Implementation

SQL-Matrix is defined by a:

  • Columns mapping:
    Column Required Default Type Decription
    Rows Yes String Name of the column of the data source which contains the values that will be used as Y Axis, or as rows of the matrix.
    Rows description No String Name of the column of the data source which contains the values that will be used as Y Axis Label.
    Columns Yes String Name of the column of the data source which contains the values that will be used as X Axis, or as rows of the matrix.
    Columns description No String Name of the column of the data source which contains the values that will be used as X Axis Label.
    Selector No String Name of the column of the data source which contains the values that will be used as Z Axis. The Z Axis enables a selector which changes the content of the matrix for the chosen data.
    Selector description No String Name of the column of the data source which contains the values that will be used as Z Axis Label.
    Values Yes String Name of the column of the data source which contains the values that will be used as matrix elements or entries.
  • XSQL Statement: Which provides the data source to be shown in the matrix component. It should contains the rowid column in order to allow matrix transactions.
  • Authoritations: Which provides the data source to be shown in the matrix component. It should contains the rowid column in order to allow matrix transactions.
  • Cell styles: A SQL-Matrix allows the use of styles (background color, text font, icons, ...) both static and conditional. The first ones are those styles that are always applied, the second depend on an application expression.
  • Initial filter: SQL condition that will be used on as ‘q’ constant at the SQL-Matrix first load. The ‘q’ constant can be used in the SQL statement and provides the filtering conditions provided by.

 

4 Transaction

A SQL-Matrix also allows to modify the content in the database. For a SQL-Matrix to allow transactions, a series of parameterization features must be taken into account:

  • It must have editable input. An input is defined as editable by the structure of wic_jrep_box_celldata_auth.
  • The SQL statement must return the rowid internal column of the main table, selected in the FROM clause of the statement.
 

5 Example

Now, let's make an example which consists of showing a SQL-Matrix where the rows represent shoe sizes, the columns indicates the color of shoe and finally the values represents the number of items.

 

5.1 Parameterization

Field value
sqlstmt
Copy
SELECT rowid, item_code, item_color, item_size, line_qty
   FROM studio_matrix_order_line 
WHERE order_code = ${order_code}
ORDER BY item_code, item_color, item_size
Column axis y item_size
Column axis x item_color
Column value line_qty
 

5.2 Data source

As a result of the defined parametrization of SQL Matrix, it can be obtain a data source such:

rowid item_code item_size item_color line_qty
1 ART01 XS Black 3
2 ART01 XS Blue 5
3 ART01 XS Green 83
4 ART01 XS Yellow 0
5 ART01 XS Red 3
6 ART01 S Black 39
7 ART01 S Blue 5
8 ART01 S Green 58
9 ART01 S Yellow 0
10 ART01 S Red 53
11 ART01 M Black 3
12 ART01 M Blue 5
13 ART01 M Green 8
14 ART01 M Yellow 0
15 ART01 M Red 53
16 ART01 L Black 3
17 ART01 L Blue 50
18 ART01 L Green 8
19 ART01 L Yellow 0
20 ART01 L Red 13
21 ART01 XL Black 3
22 ART01 XL Blue 5
23 ART01 XL Green 8
24 ART01 XL Yellow 0
25 ART01 XL Red 3

Finally we obtain: