Jump to content
  • This documentation is an older version of JasperReports Server Data Management Using Domains. View the latest documentation.

    The hierarchy of data islands, sets, and items are defined through the dataIslands and itemGroups elements and their children. These two elements, which are defined together, are direct children of the top-level schema element.

    Presentation Hierarchy

    The following hierarchy is used to represent data islands, sets, and items. This hierarchy is at the top level, directly under the schema element.

    	 (0...1)		 (1...n)	 (1...n)		 (0...n)			 (0...n) 					    		 (0...n)		            		 (0...n) 				 (0...n)					 (1...n)					...				 (0...n)				 (1...n)							 (0...n)			 (1...n)	 (0...n)		 (1...n)[/code]                    

    The itemGroups and items elements are recursive elements that are equivalent to the sets and items on the Data Presentation tab of the Domain Designer. They create a hierarchy of sets, subsets and items and hold attributes that define all the properties available on sets and items. For a description of each possible property, see Properties.

    dataIslands

    The dataIslands element lists all the data islands on the Data Presentation tab. A schema can have at most one dataIslands element. If there are no data islands in the presentation, the dataIslands element is not required.

    Each data island in the Domain must be represented by an itemGroup child of the dataIslands element. dataIslands is a child of schema.

    Child Elements

    Element Name

    Description
    <itemGroup>

    (Required) As a child of dataIslands, each itemGroup represents a data island.

    itemGroup

    As a child element of dataIslands, itemGroup represents a data island. Each itemGroup in the dataIslands element corresponds to an itemGroups element that describes the hierarchy of sets and items in the data island. There can be at most one data island for each join tree or unjoined table.

    note-icon-ns.png.5566be770d2192ed5a0a6546c2946105.png

    itemGroup is also used to represent a set in the Domain presentation. See itemGroup for more information.

    XML Attributes

    Attribute

    Type

    Description

    id

    String

    (Required) Unique identifier for the data island in the Domain design file. The id XML attribute can contain alphanumeric characters along with any combination of the following: @#$^`_~? It cannot start with a digit.

    The id attribute is used by other elements in the presentation representation to identify the data island, via the referenceId. In XML files exported from Domain Designer, the id attribute corresponds to the data island's ID property on the Data Presentation tab.

    label String The data island's name, visible to users of the Domain. If the label is missing, the Ad Hoc Editor displays the id. Corresponds to Label on the Data Presentation tab.
    description String A description of the set, visible to users as a tooltip on the set name in the Ad Hoc Editor. Corresponds to Description on the Data Presentation tab.
    labelId String The internationalization key for the label in the Domain’s locale bundles. Corresponds to Label Key on the Data Presentation tab. Can contain alphanumeric characters along with any of the following: .`~_
    descriptionId String The internationalization key for the description in the Domain’s locale bundles. Corresponds to Descriptions Key on the Data Presentation tab. Can contain alphanumeric characters along with any of the following: .`~_
    resourceId String

    (Required) resourceId of the jdbcTable or jdbcQuery element for the join tree or unjoined table that corresponds to the data island. jdbcQuery is only used in the case when your data island comes from a derived table that isn't joined to anybody.

    itemGroups

    itemGroups – A container for itemGroup elements and/or items elements. Each instance of itemGroups corresponds to a data island defined as an itemGroup in dataIslands.

    All descendents of a specific itemGroups element must refer to the same join tree or unjoined table. This means that the resourceId attribute of all descendents of an itemGroups element must reference the id attribute of the same jdbcTable or jdbcQuery.

    You can upload a Domain with an empty itemGroups element, but for the corresponding data island to be used, it must contain at least one itemGroup or items element.

    A recursive relationship between itemGroups and itemGroup is used to show sets and subsets. The top-level element in a set hierarchy is always an itemGroups element. Every itemGroups element must contain at least one items or itemGroup element.

    Child Elements

    Element Name

    Description
    <itemGroup>

    A set in the data presentation.

    <items>

    A container for item elements.

    itemGroup

    As a child of the itemGroups element or itemGroup element, itemGroup represents a set or subset. itemGroup contains itemGroups elements and/or items elements. Set properties are represented as attributes.

    A recursive relationship between itemGroups and itemGroup is used to show sets and subsets. The top-level element in a set hierarchy is always an itemGroups element. Every itemGroups element must contain at least one items or itemGroup element.

    note-icon-ns.png.80ccbbbf3859cb6bcbdbcc52e41beaac.png

    itemGroup is also used to represent a data island in dataIslands. See itemGroup for more information.

    Child Elements

    The hierarchy of itemGroups and items elements defines the hierarchy of sets and items in the data island.

    Element Name

    Description
    <itemGroups>

    A container for itemGroup elements, which represent sets.

    <items>

    A container for item elements, which represent items.

    XML Attributes

    The attributes of itemGroup specify the properties of the set or data island. See Properties for more information.

    Attribute

    Type

    Description

    id String

    (Required) The unique identifier of the set among all set and item IDs. The id XML attribute can contain alphanumeric characters along with any combination of the following: @#$^`_~? It cannot start with a digit.

    The id attribute is used by other elements in the presentation representation to identify the set. In XML files exported from Domain Designer, the id attribute corresponds to the set's ID property on the data presentation tab.

    label String The set’s name, visible to users of the Domain. If the label is missing, the Ad Hoc Editor displays the id. Corresponds to Label on the Data Presentation tab.
    description String A description of the set, visible to users as a tooltip on the set name in the Ad Hoc Editor. Corresponds to Description on the Data Presentation tab.
    labelId String The internationalization key for the label in the Domain’s locale bundles. Corresponds to Label Key on the Data Presentation tab. If blank, the default key is used. Can contain alphanumeric characters along with any of the following: .`~_
    descriptionId String The internationalization key for the description in the Domain’s locale bundles. Corresponds to Descriptions Key on the Data Presentation tab. If blank, the default key is used. Can contain alphanumeric characters along with any of the following: .`~_
    resourceId String (Required) id of the join tree or unjoined table that contains this set, as specified in dataIslands. The resourceId attribute must be the same for all item and itemGroup elements that descend from the same itemGroups element.

    When an internationalization key is defined for the label or description, the label or description is replaced with the value given by the key in the local bundle corresponding to the user’s locale. See Localizing Domains.

    items

    The items element is a container for item elements, which represent items on the Data Presentation tab. items can be a child of itemGroup or schema.

    As a child of schema, items is a container for items in a single data island that do not belong to any a set. All item elements in an items element must belong to the same data island. There is one items element in schema for each data island that has items that are not in a set.
    As a child of itemGroup, items is a container for the items in the set represented by itemGroup.

    Child Elements

    Element Name

    Description
    <item>

    An item in the data presentation.

    item

    The item element represents an item in the data presentation of the Domain. An item is the representation of a database field or a calculated field along with the display name and formatting properties defined in the Domain.

    XML Attributes

    The attributes of item specify the properties of the item. See Properties for more information.

    Attribute

    Type

    Description

    id String (Required) The unique identifier of the item among all set and item IDs. The id XML attribute can contain alphanumeric characters along with any combination of the following: @#$^`_~? It cannot start with a digit.

    By default, the Domain Designer uses the name of the field as the id. If there are multiple instances of the field in the data island, then the Domain Designer appends a number to the name, such as field2.

    label String The item’s name, visible to users. If the label is missing, the Ad Hoc Editor displays the id.
    description String

    An optional description of the item, visible as a tooltip on the item name in the Ad Hoc Editor.

    labelId String The internationalization key for the label in the Domain’s locale bundles. Can contain alphanumeric characters along with any of the following: .`~_
    descriptionId String The internationalization key for the description in the Domain’s locale bundles. Can contain alphanumeric characters along with any of the following: .`~_
    resourceId String

    (Required) A reference to the column on which the item is based. This defines the connection between what the user sees and the corresponding data in the data source. The precise format depends on the location of the column in the data structure:

    When the item refers to a column in an unjoined table, resourceId has the form table_id.field_ID.
    When the item refers to a column in a join tree, resourceId has the form
    jointree_id.table_ID.field_name.

    In the Domain Designer, table_id and jointree_id can be set using the Rename... option from the context menu on the Joins tab.

    The table_id or jointree_id component of the resourceId attribute must be the same for all item and itemGroup elements that descend from the same itemGroups element.

    dimensionOrMeasure Field or
    Measure

    Corresponds to the Field or measure setting in the user interface. Its possible values are Dimension (equivalent to field) or Measure.

    This attribute is optional and necessary only when overriding the default behavior, for example to make a numeric item explicitly not a measure. By default, all numeric fields are treated as measures in the Ad Hoc Editor.

    defaultMask See table

    A representation of the default data format to use when this item is included in a report. The possible values depend on the type attribute of the column referenced by the resourceId. See Data Formats for Aggregation by Type for the data formats available for each type.

    defaultAgg See table.

    The name of the default summary function (also called aggregation) to use when this item is included in a report. The possible values for the defaultAgg depend on the type attribute of the column referenced by the resourceId. See Default Summary Functions By Type for the possible summary functions based on the column type. The Appearance column shows the equivalent setting in the Data Presentation tab.

    Labels and descriptions may contain any characters, but the ID property value of both itemGroup and item elements must be alphanumeric.

    Data Formats for Aggregation by Type

    Content Type

    Attribute Value

    Appearance

    Integer

    #,##0
    0
    $#,##0;($#,##0)
    #,##0;(#,##0)

    -1,234
    -1234
    ($1,234)
    (1234)

    Double

    #,##0.00
    0
    $#,##0.00;($#,##0.00)
    $#,##0;($#,##0)

    -1,234.56
    -1234
    ($1,234.56)
    ($1,234)

    Date

    short
    hide medium
    hide long
    medium

    3/31/09
    Mar 31, 2009
    March 31, 2009
    23:59:59

    All others

    Not allowed

    Default Summary Functions By Type

    Attribute Value

    Appearance

    Max

    Min

    Average

    Sum

    CountDistinct

    CountAll

    Maximum

    Minimum

    Average

    Sum

    Distinct Count

    Count All

    Example

    For example, suppose you have a join tree, JoinTree_1, with the following hierarchy:

    A set labeled Accounts
    A subset of Accounts, with the label Account Address
    A single element, Account Creator, that is in the join tree, but is not in any set.

    Example of a Join Tree Hierarchy

    js-DomainSyntax-JoinTree.png.f39d8af4346631a182b67582afd44684.png

    The XML for this join tree might look like this:

                                                                                                    [/code]                    


    User Feedback

    Recommended Comments

    There are no comments to display.



    Guest
    This is now closed for further comments

×
×
  • Create New...