XML—attachment type: TABLE

The XML code illustrates the format for the XML that is streamed for TABLE attachments.

<TableData>
 <MetaData>
  <TableTitle>[String Value]</TableTitle>
  <MultiRowHeading>Y|N</MultiRowHeading>
  <Column name="[String Value]">
   <Label>[String]</Label>
   <DBType>2|12|91|93</DBType>
   <ToolTip>[String Value]</ToolTip>
   <Visible>Y|N</Visible>
  </Column>
  <Column name="[String Value]">
   <Label>[String]</Label>
   <DBType>2|12|91|93</DBType>
   <ToolTip>[String Value]</ToolTip>
   <Visible>Y|N</Visible>
  </Column>
  <Column name="[String Value]">
   <Label>[String]</Label>
   <DBType>2|12|91|93</DBType>
   <ToolTip>[String Value]</ToolTip>
   <Visible>Y|N</Visible>
  </Column>
  <Notes>
   <NotesDetail title="[String Value]">[HTML Formatted String Value]</NotesDetail>
   <NotesDetail title="[String Value]">[HTML Formatted String Value]</NotesDetail>
   <NotesDetail title="[String Value]">[HTML Formatted String Value]</NotesDetail>
  </Notes>
 </MetaData>
 <Row>
   <Column name="[String Value]">[String Value]</Column>
   <Column name="[String Value]">[String Value]</Column>
   <Column name="[String Value]">[String Value]</Column>
 </Row>
 <Row id="[String Value of Row Number]">
   <Column name="[String]">[String Value]</Column>
   <Column name="[String]">[String Value]</Column>
   <Column name="[String]">[String Value]</Column>
 </Row>
</TableData>

The <Metadata> contains the column definitions, an optional title or header above the table and notes. The contents of notes for tables are determined by <Notes> and <NotesDetail> XML elements. The XML must contain all these elements except for <NotesDetail>.

The <Row> elements contain the data for the table, and optional notes for the table. See Figure 2-11, Attachment—View, and Figure 2-12, Attachment—View and Show Notes. The rows of the table are determined by XML children of the <TableData> element that is streamed with the attachment.

  1. <MetaData>—Define <MetaData> as a child of <TableData> and define the following child elements of <MetaData>.
    1. <TableTitle>—Define with optional text to be displayed above the table for additional information about the data, such as a filter. You must set the content of this element to empty <TableTitle/> if there is no text to display.
    2. <MultiRowHeading>—Define with content of Y or N. Set the value to Y to display two rows of column headers when the attachment is displayed. The first row displays the first word of each column label and the second row displays the rest of each label. For example, use this if you have two rows of columns in your table where the first row has the same word across more than one column and the second row has a distinguishing label.

    The following column headers appear if MultiRowHeader is set to Y.

    All All Serious Serious

    N Since 2010

    EBGM 2012

    N Since 2010

    EBGM 2012

    If the value to set to N, then only one row of column headers is displayed.

    All All Serious Serious

    N Since 2010

    EBGM 2012

    N Since 2010

    EBGM 2012

    1. <Column>—Specify a list of <Column> header elements where there is one column element for each column header in your attachment. Set the name attribute to an arbitrary string that is used to match the same column name attribute in the <Row> elements that contain the row data.
    • <Label>—Set the <Label> content to the text to display in the column header.
    • <DBType>—Set the <DBType> content to the column type integer value as described in Table A–1. This value is used for formatting values in the table such as left or right justification of the text. Numbers are right aligned. All other types are left aligned.
    • <ToolTip>—Set the <ToolTip> content to the text to display for the tooltip on the column name or <ToolTip/> if there is no tooltip.
    • <Visible>—Set the <Visible> content to the default visibility of the column. Set to Y to show this column by default or N to hide this column. Users can select the Columns link to show or hide columns when viewing the attachment.
    1. <Notes>—Define children for the <Notes> elements to display the Show Notes link above the table when the attachment is displayed. If you do not have notes, then you must specify an empty notes element <Notes/> and the Show Notes link will not be displayed in the attachment.

      Notes are displayed as a table with two columns. The <Notes> tag has one or more optional <NotesDetail> child elements. Define the title attribute to the text for the first column of the note table such as a note row label. Define the content of the <NotesDetail> for text of the second column, such as a note row value or <NotesDetail/> if there is no text for this row. The <NotesDetail> content can optionally contain HTML tags for formatting and can contain HTML <table> related tags to embed a table in the second column of the notes.

  2. <Row>—Define a list of <Row> elements with one <Row> for each row in your table. For each <Row> , define the following child elements.
    1. <Column>—You must define one <Column> child element for each <Column> element that is a child of the <Metadata> element, and define the same name attribute. This name can be any unique name for the column. Set the content of this element to the text to be displayed in the content of this column's row in the table.

    If the column name is set to reviewed or excluded, which are used by Empirica applications, then any data in those columns are left aligned regardless of the DBType attribute. The values of the rows for these column names are displayed as YES if set to 1 or NO if set to 0.