The ANNOTATIONS Column

ANNOTATIONS is an optional column in the CUBES, DIMENSIONS, HIERARCHIES, and MEMBERS schema rowsets. OLE DB for OLAP supports the ability to annotate values in these schema rowsets, which allows for reminders, notes, and the like to be stored with the data. Groups of cells or individual cells can be annotated. The annotation string is stored as a cell property and must be in XML format. The content of the ANNOTATIONS column is updated through IRowsetChange.

Contents of the Annotations String

The annotation string is in XML format, as shown in the following example:

<?xml version="1.0"?>
<annotations>
   <annotation>
   <text>The numbers for this quarter look low.</text>
   <author>J. Smith</author>
   </annotation>
   <annotation>
   <text>Soda sales are slipping.</text>
   </annotation>
</annotations>

The XML schema described below is an example using XML-Data syntax, which can be used to enhance the annotation capability. (The preceding example string is pure XML.)

Note

XML-Data is a convenient syntax for describing the data, but the client is not required to understand XML-Data or to have access to the XML schema in order to use annotations.

The following table describes each XML element tag available for annotating data.

Element

Description

anntext

The complete text of the annotation. Can be localized.

anndate

The date with optional time and optional time zone, expressed using ISO 8601 format. Example: "1988-04-07T18:39:09-08:00".

author

The author of the annotation. Can be localized.

initials

The author's initials. Can be localized.

The following XML schema defines the element types listed in the preceding table:

<?xml version="1.0"?>
<Schema name="annotation"
 xmlns="urn:schemas-microsoft-com:xml-data"
 xmlns:dt="urn:schema-microsoft-com:datatypes">
   <ElementType name="anntext"/>
   <datatype dt:type="string"/>
   </ElementType>
   
   <ElementType name="anndate">
   <datatype dt:type="dateTime.tz"/>
   </ElementType>

   <ElementType name="author"/>
   <datatype dt:type="string"/>
   </ElementType>

   <ElementType name="initials"/>
   <datatype dt:type="string"/>
   </ElementType>

   <ElementType name="singleAnnotation">
   <element type="#anntext" occurs=REQUIRED/>
   <element type="#anndate" occurs=OPTIONAL/>
   <element type="#author" occurs=OPTIONAL/>
   <element type="#initials"occurs=OPTIONAL/>
   </ElementType>

   <ElementType name="annotations">
   <element type="#singleAnnotation" occurs=ONEORMORE/>
   </ElementType>
</Schema>