In this section:
How to: |
You can create an aggregated grid by using any other ibiDataGrid as the data source. For example, by using the first grid MAIN01 as the data source, you are essentially reusing data already loaded into the application. To do that, you must establish a parent/child relationship between the two grids, in which the parent grid is the source of data for the other grid.
For SDK 3.x:
<mx:Canvas label="Aggregated Grid" width="100%" height="100%"> <ibi:ibiDataGrid x="25" y="22" width="345" id="SUB01" ibiParent="MAIN01" ibiUseColumns="REGION,ST"/> </mx:Canvas>
For SDK 4.x:
The ibiUseColumns property, available in the ibiDataGrid component, allows you to apply spaces, tabs, and carriage returns to add values over multiple lines.
A property called ibiUseAggSort is available to improve the performance of the application when the data is sorted and aggregated in IBI components. When this is set to true in the components that use ibiGroupBy field to aggregate data, it uses the custom sort function instead of the sort functionality of Flex to perform data aggregation. The default is set to false.
In addition to aggregating column values using the Sum. prefix in the field name, you can use the following prefix operators to perform different calculations directly in the data grid.
Prefix |
Operation |
---|---|
Average. |
Computes the average value of the field. |
Count. |
Counts the number of occurrences of the field. |
Distinct. |
Counts the number of distinct values within the field. |
GrandTotal. |
Generates the total column values for the field. |
Max. |
Generates the maximum value of the field. |
Min. |
Generates the minimum value of the field. |
Percent. |
Computes the percentage of a field based on the total values for the field. |
Sum. |
Sums the field values. |
The GrandTotal prefix automatically sums and creates a column total of all values in a specific field. To specify having no ibiGroupBy field, use the following syntax:
ibiGroupBy="*"
You can use the Compute. prefix operator to add derived columns into ibiDataGrid based on user defined calculations using the columns available in the data retrieved, in addition to using supported prefix operators to provide basic calculations.
The Compute. prefix can be used with the following syntax.
Compute.define_function_name(field_name1, field_name2,...)
where:
Is the name of the function that defines the calculations.
Is the name of the field used in the function. The number of fields corresponds to the number of arguments specified in the function that defines the calculations.
Note: You need to define the calculation and reload data into the data grid with the new columns using an ActionScript function in the <mx:Script> section of the application.
Flex provides many capabilities for reusing content. You can copy and paste compound components, for example, a grid that is nested in a panel.
Regional Category Sales
WebFOCUS |