GET Export Report HTMLTABLE Format


Description of the HTMLTABLE export format of the GET Export Report API.

Table of Contents

The htmltable format writes HTML to the HTTP response body. The returned HTML is internally valid XML but not valid HTML since it is neither encapsulated with <html> nor <body> tags. This allows the returned HTML to be embedded within the DOM of an HTML Document.

Format Parameter:  htmltable

Response Content-Type:  text/html

OK Response

Status Code:  200

HTML Table responses without error have this DTD structure:

<!DOCTYPE table [
<!ELEMENT table (caption?,thead,tbody)>

<!ELEMENT caption (aside,h5,ul)>

<!-- aside: Contains the total row count -->
<!ELEMENT aside (#PCDATA)>

<!-- h5 and ul: optionally rendered if at least one filter or subquery with a description 
     is applied to the export results. In the case of filters, the h5 contains the 'Filters' 
     title, and the ul contains human-readable filters (with table and column displayName
     substituted for id's) in a bulleted list. In the case of subqueries with a description, 
     the h5 contains the 'Subqueries' title, and the ul contains the <subquery> description. -->
<!ATTLIST h5 class CDATA>

<!ELEMENT ul (li)>

<!ELEMENT li (#PCDATA|em|samp)>

<!ELEMENT thead (tr)>

<!ELEMENT tbody (tr)>

<!ELEMENT tr (th|td)>

<!-- th: Contains the <column> displayName -->

<!-- th attributes: The 'tablePath' and 'columnId' value of each column is added as a data 
     attribute for every column header. This makes it possible to find the column associated
     with a given tablePath and columnId with a selector tool like JQuery. -->
<!ATTLIST th data-tablePath CDATA>
<!ATTLIST th data-columnId CDATA >

<!-- td: Contains the row value -->

<!-- a: <column>'s with a <url_template> have their values surrounded with an HTML anchor
     tag (a) with the filled URL template as the value of the href attribute. -->

Example 1. Example HTML Table Output Format
        <aside>From 1 to 2 of 2</aside>
        <h5 class='filters-title'>Filters</h5>
            <li>Table: <em>Student</em>, Column: <em>First Name</em> <samp>like</samp> 'J%'</li>
            <li>Table: <em>Student</em>, Column: <em>Last Name</em> <samp>=</samp> 'Hernandez'</li>
        <h5 class='subqueries-title'>Subqueries</h5>
            <li>Table: <em>Student</em>: Rows are restricted to those students within your school.</li>
            <th data-tablepath="/student" colspan="3">Student</th>
            <th data-tablePath="/student" data-columnId="id">Student ID</th>
            <th data-tablePath="/student" data-columnId="fname">First Name</th>
            <th data-tablePath="/student" data-columnId="lname">Last Name</th>
            <td><a href="/some/url/177">Hernadez</a></td>
            <td><a href="/some/url/213">Hernadez</a></td>

Error Response

Status Code:  400 and 500

HTML Table responses with error have this structure:

<!DOCTYPE ul [
<!ELEMENT ul(li)>
<!ATTLIST ul class CDATA "error">

Example 2. Example HTML Table Error Output Format
<ul class="error">
    <li>The filter "/student@id &amp; 173" does not match filter grammar. The "Operator" definition is missing or unparseable.</li>