- 1 Result Set Sharing
Result Set Sharing
This project aims to enable multiple BIRT report items to share the same data binding definition and result set.
Gary Xue, Actuate Corp.
Rima Kanguri, Actuate Corp.
2007-4-11 [Gary Xue]: Initial draft
This feature enables multiple report items in a BIRT report to share a single result set. A result set is the runtime data calculated based on a set of data binding definitions, which include:
- A data set (for tabular result set) or a cube (for cross-tab result set) as the source of data
- Grouping definition (tabular result set only)
- Calculations and aggregations based on data set/cube data
Sharing of result sets permits two or more report items to present different views of the same data, without constraints on the physical placements of these elements. This contrasts with subqueries, which achieves the same effect to a lesser extent, but requires physical containment relationship of related report elements. Result set sharing also permits changes made to the data definition of one report elements to be reflected in other elements sharing the same data. For example, a filter added to a table will also apply to a chart that shares the table’s result set.
Overview of Changes
- Filter, sort and group definition in Model will be consolidated into a Data Binding Definition structure. All data-enabled report items (including extended items) will contain this structure.
- A report item can reference another report item’s data bindings in lieu of defining its own, thus enabling sharing of the other item’s result set.
- Current model’s Group Definition (which only applies to listing items) will be split into two parts: the data group definition (part of Data Binding Definition), and group layout definition (applies to listing items).
Model and Design Engine API Changes
New structure DataGroup
This structure contains properties in the existing ListingGroup element which defines the data aspects of a group.
|keyExpr||Expression||Group key expression|
|sort||SortKey||Group sort condition|
|groupName||String||Name of group|
|intervelBase||String||Group interval base value|
|interval||interval||Group interval type|
|intervalRange||float||Ranged-based interval range value|
|sortDirection||sortDirection||Simple sort direction|
|sortType||sortType||complex sort type|
Changes to ListingGroup
The ListingGroup element will deprecate all properties that have been moved to DataGroup, except for the groupName property. groupName is the key that associated a ListingGroup element with the corresponding DataGroup element in the DataBinding structure (see below).
When a deprecated property is accessed in ListingGroup, DE will look up the corresponding DataGroup in the DataBinding structure associated with the listing item (by matching their groupName), and read/write that property instead.
New structure DataBinding
This structure defines the data binding definition of a report item that can access data.
|dataSet||elementRef||Reference to a data set; for tabular items|
|cube||elementRef||Reference to a cube; for x-tab items|
|paramBindings||ParamBinding||Data set/cube parameter binding|
|boundColumns||List of ComputedColumn||Result set bound column list|
|sort||SortKey||Group sort condition for result set|
|groups||List of DataGroup||Data group definition for result set|
|filter||List of FilterCondition||Filter definition for result set|
Changes to ReportItem and its subclasses
The following new properties will be added to ReportItem:
|dataBinding||DataBinding||Report item’s own data binding definition|
|dataBindingRef||elementRef||Reference to another report item. This report item will use the referenced item’s data binding definition. If dataBindingRef is set, dataBinding property must be empty.|
Properties in ReportItem and its derived elements (such as ListingItem) that have been moved to Databinding will be deprecated.
Engine and Data Engine API Changes
Data Engine API: the IQueryResults and ICubeQueryResults interfaces will introduce new methods to obtain a new iterator for the current query result. This will enable Engine to operate multiple concurrent cursors on the same (shared) result set.
Engine changes: Engine will call DTE API to prepare and execute each shared DataBinding only once. It will request a new iterator on the same query result for each report item that uses the shared binding.
Designer UI Changes
Designer needs to introduce the following features (details TBD):
- Allow a report item to refer to another report item in its data binding definition
- Warn the user that any edits to shared bindings will affect multiple report items
- Allow un-sharing of bindings (in which case the shared bindings will be copied to the referring report item).