The following example is a simple channel displaying some store metrics by city in a simple list.
SQL statement sentence:
<select> <columns> store_city, SUM(store_sales) <alias name='store_sales'/>, SUM(store_cost) <alias name='store_cost'/>, SUM(unit_sales) <alias name='unit_sales'/> </columns> <from table='sales_fact_1998' > <join table='store'> <on>store.store_id = sales_fact_1998.store_id</on> </join> </from> <group>1</group> </select>
Assign a table to each columns so that the labels can be used from the dictionary database. In the example below can be seen how the column store_sales has been assigned to the table sales_fact_1998 and so on.
Channel Execution Result:
In the following example we will allow the user to decide which states want to view. We will need to change the SQL:
<select> <columns> store_city, SUM(store_sales) <alias name='store_sales'/>, SUM(store_cost) <alias name='store_cost'/>, SUM(unit_sales) <alias name='unit_sales'/> </columns> <from table='sales_fact_1998' > <join table='store'> <on>store.store_id = sales_fact_1998.store_id</on> </join> </from> <where> store_state IN $0 </where> <group>1</group> </select>
And add the following options to the data selection box:
The value defined in object must be an object defined in wic_jrep_object
That is, in this example it must exist an object called store_states
The following example shows how to add column styles.
This section contains the 'Style' box, where te user can define the style of the wished column.
The styles available by default are:
- Aligment: Sets the text aligment (AUTO, LEFT, RIGHT, CENTER or JUSTIFY).
- Neutral: No style aplyed.
- Good: Background color green for positive values and red for negative.
- Bad: Background color red for positive values and green for negative.
- Decim.: Decimals displayed.
For more customized styles use Range and Range column, where Range is assigned with a 'Channel range' and the Range column refers to the column wich values will determine the style.
This feature has been replaced by the
Table Colorizer view util. See Table Colorizer section for further information.
In the following case is shown how to group columns and get totals.
The headland used to implement the groups and totals is the 'Atributes' box. The two parameters that the user needs to modify for this purpose are Group and Total.
For this example one column with customers information, 'fullname', has been added.
In order to group the information by cities, notice that the Group parameter in 'store_city' has value 1. This will group the information by the store's city.
Also, see that the Total check box is selected on 'store_sales', 'store_cost' and 'unit_sales' columns. As it is shown in the Result section, this is going to display an extra row, for each group, with the total value corresponding to each column.
The following example shows how to incorporate links to the values of a column. Those are usually for showing up more details about the linked value, or even change some information of it.
The area in charge of this purpose is the 'Links' box, where the user must specify the Type of column link, the Link code and the Condition.
On this example, the customer information will be linked by its name on the table. For this, an SQL Object is used as a 'Type of column link' and the 'Link code' corresponds to the object that is going to be called. The 'Condition' points out which information of the SQL object is going to be displayed.
See in the Result area below, how the customer name has changed its style, as it has became a link.
This section explains how to create headers that can group multiple columns.
The parameter responsible for this is the
Header, located in the 'Attributes' box. See in the table below how are they assigned
to the columns.
The headers must exist, that means that they have to be pre-defined in the 'Column headers' section.
The values of a column can be editable. To allow this, the Editable checkbox on the 'Attributes' box needs to be selected.
Nevertheless, there are two indispensable conditions to consider:
- The column must belong to the principal table of the select.
- Also the rowid of this table has to be defined (can be hidden).
The editable column may be an input, a select or a checkbox, depending on the attribute it has associated.
It is important to bear in mind that columns with graphs, SVG or a superlist graph, can't be edited by the user at the desktop.