QueryTable Class

Query Table. It is the root element of QueryTablePart.When the object is serialized out as xml, its qualified name is x:queryTable.

Inheritance Hierarchy

System.Object
  DocumentFormat.OpenXml.OpenXmlElement
    DocumentFormat.OpenXml.OpenXmlCompositeElement
      DocumentFormat.OpenXml.OpenXmlPartRootElement
        DocumentFormat.OpenXml.Spreadsheet.QueryTable

Namespace:  DocumentFormat.OpenXml.Spreadsheet
Assembly:  DocumentFormat.OpenXml (in DocumentFormat.OpenXml.dll)

Syntax

'Declaration
<ChildElementInfoAttribute(GetType(QueryTableRefresh))> _
<ChildElementInfoAttribute(GetType(ExtensionList))> _
Public Class QueryTable _
    Inherits OpenXmlPartRootElement
'Usage
Dim instance As QueryTable
[ChildElementInfoAttribute(typeof(QueryTableRefresh))]
[ChildElementInfoAttribute(typeof(ExtensionList))]
public class QueryTable : OpenXmlPartRootElement

Remarks

The following table lists the possible child types:

  • QueryTableRefresh <x:queryTableRefresh>

  • ExtensionList <x:extLst>

[ISO/IEC 29500-1 1st Edition]

18.12.2 queryTable (Query Table)

This element specifies all the relevant properties for a query table, one query table element is stored for each query table object in the spreadsheetML document.

Parent Elements

Root element of SpreadsheetML Query Table part

Child Elements

Subclause

extLst (Future Feature Data Storage Area)

§18.2.10

queryTableRefresh (QueryTable Refresh Information)

§18.12.6

Attributes

Description

adjustColumnWidth (Adjust Column Width On Refresh)

Specifies whether to automatically adjust column widths on refresh to fit the data retrieved. true if column widths should be adjusted.

The possible values for this attribute are defined by the W3C XML Schema boolean datatype.

applyAlignmentFormats (Apply Alignment Formats)

If true apply legacy table autoformat alignment properties.

The possible values for this attribute are defined by the W3C XML Schema boolean datatype.

applyBorderFormats (Apply Border Formats)

If true apply legacy table autoformat border properties.

The possible values for this attribute are defined by the W3C XML Schema boolean datatype.

applyFontFormats (Apply Font Formats)

If true apply legacy table autoformat font properties.

The possible values for this attribute are defined by the W3C XML Schema boolean datatype.

applyNumberFormats (Apply Number Formats)

If true apply legacy table autoformat number format properties.

The possible values for this attribute are defined by the W3C XML Schema boolean datatype.

applyPatternFormats (Apply Pattern Formats)

If true apply legacy table autoformat pattern properties.

The possible values for this attribute are defined by the W3C XML Schema boolean datatype.

applyWidthHeightFormats (Apply Width / Height Formats)

If true apply legacy table autoformat width/height properties.

The possible values for this attribute are defined by the W3C XML Schema boolean datatype.

autoFormatId (Auto Format Id)

Identifies which legacy table autoformat to apply.

Annex D contains a listing of the supported PivotTable AutoFormats, example formatting, and a sample workbook with each of those AutoFormats applied.

The possible values for this attribute are defined by the W3C XML Schema unsignedInt datatype.

backgroundRefresh (Background Refresh)

Specifies whether or not the query table shall try to refresh data in the background.

The possible values for this attribute are defined by the W3C XML Schema boolean datatype.

connectionId (Connection Id)

Specifies the ID number of the external data connection to use to refresh data in the query table.

The possible values for this attribute are defined by the W3C XML Schema unsignedInt datatype.

disableEdit (Disable Edit)

Specifies whether the connection element used with this query table shall be editable. If true, then the connection is not editable.

The possible values for this attribute are defined by the W3C XML Schema boolean datatype.

disableRefresh (Disable Refresh)

Specifies whether the query table shall be refreshable. If true, then then query table is not refreshable.

The possible values for this attribute are defined by the W3C XML Schema boolean datatype.

fillFormulas (Fill Adjacent Formulas)

Specifies whether or not formulas in columns adjacent to the query table should be filled down whenever the query table is refreshed. This is helpful since the number of rows returned by a query table refresh operation can vary.

The possible values for this attribute are defined by the W3C XML Schema boolean datatype.

firstBackgroundRefresh (First Background Refresh)

Specifies whether or not data has ever been refreshed for this query table. If the very first background data refresh had not completed at the time the file was saved, this attribute is set to true.

The possible values for this attribute are defined by the W3C XML Schema boolean datatype.

growShrinkType (Grow Shrink Type)

Specifies the type of behavior expected for dealing with a variable number of rows of data in the query table between refresh operations.

The meaning of the possible values of this attribute {insertClear, insertDelete, overwriteClear} are explained in detail in the definition of the simple type.

The possible values for this attribute are defined by the ST_GrowShrinkType simple type (§18.18.39).

headers (First Row Column Titles)

Specifies whether or not the query table has first row with column titles.

The possible values for this attribute are defined by the W3C XML Schema boolean datatype.

intermediate (Intermediate)

Specifies whether this query table is in an intermediate state, having been defined but not fully formed and populated with data.

In this state, fields and ranges of the query table can be unknown.

The possible values for this attribute are defined by the W3C XML Schema boolean datatype.

name (QueryTable Name)

Specifies the name of the query table.

The possible values for this attribute are defined by the ST_Xstring simple type (§22.9.2.19).

preserveFormatting (Preserve Formatting On Refresh)

Specifies whether the application should try to preserve formatting in the query table and copy this formatting to any new rows of data.

The possible values for this attribute are defined by the W3C XML Schema boolean datatype.

refreshOnLoad (Refresh On Load)

Specifies whether the query table shall refresh its data automatically when the spreadsheetML document is loaded or opened.

The possible values for this attribute are defined by the W3C XML Schema boolean datatype.

removeDataOnSave (Remove Data On Save)

Specifies whether the query table shall remove all data from the worksheet before the spreadsheetML document is saved.

This is very helpful for situations where people who have different permissions to view data want to share the same spreadsheetML document. All data from the last user is removed, and new users re-query the external data sources with their own credentials.

The possible values for this attribute are defined by the W3C XML Schema boolean datatype.

rowNumbers (Row Numbers)

Specifies whether the query table shall include a first column of row numbers.

The possible values for this attribute are defined by the W3C XML Schema boolean datatype.

[Note: The W3C XML Schema definition of this element’s content model (CT_QueryTable) is located in §A.2. end note]

© ISO/IEC29500: 2008.

Thread Safety

Any public static (Shared in Visual Basic) members of this type are thread safe. Any instance members are not guaranteed to be thread safe.

See Also

Reference

QueryTable Members

DocumentFormat.OpenXml.Spreadsheet Namespace