DocumentTable class

DocumentTable class

Provides access to data of a single table (or spreadsheet) located in an external document to be used while assembling a document.

For documents of Spreadsheet file formats, a DocumentTable instance represents a single sheet. For documents of other file formats, a DocumentTable instance represents a single table.

To access data of the corresponding table while assembling a document, pass an instance of this class as a data source to one of DocumentAssembler.AssembleDocument overloads.

In template documents, a DocumentTable instance should be treated in the same way as if it was a System.Data.DataTable instance. See template syntax reference for more information.

The DocumentTable type exposes the following members:

Constructors

Constructor Description
init Initializes a new DocumentTable using the default DocumentTableOptions.
init Initializes a new DocumentTable instance.
init Initializes a new DocumentTable instance using default DocumentTableOptions.
init Initializes a new DocumentTable instance.

Properties

Property Description
columns The collection of DocumentTableColumn objects representing columns of the corresponding table.
index_in_document The original zero-based index of the corresponding table in the source document.
name The name of this table used to access the table’s data in a template document passed to DocumentAssembler.

Example

from groupdocs.assembly import DataSourceInfo, DocumentAssembler
from groupdocs.assembly.data import DocumentTable, DocumentTableOptions

options = DocumentTableOptions()
options.max_row_index = 3
table = DocumentTable("managers.pptx", 1, options)

assembler = DocumentAssembler()
assembler.assemble_document(
    "table-row.pptx",
    "table-row-report.pptx",
    DataSourceInfo(table, "table")
)

See Also