public class DocumentTable
extends java.lang.Object
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 DataTable instance. See template syntax reference for more information.
| Constructor and Description |
|---|
DocumentTable(java.io.InputStream documentStream,
int indexInDocument)
Creates a new instance of this class using default
DocumentTableOptions. |
DocumentTable(java.io.InputStream documentStream,
int indexInDocument,
DocumentTableOptions options)
Creates a new instance of this class.
|
DocumentTable(java.lang.String documentPath,
int indexInDocument)
Creates a new instance of this class using default
DocumentTableOptions. |
DocumentTable(java.lang.String documentPath,
int indexInDocument,
DocumentTableOptions options)
Creates a new instance of this class.
|
| Modifier and Type | Method and Description |
|---|---|
DocumentTableColumnCollection |
getColumns()
Gets the collection of
DocumentTableColumn objects representing columns of the corresponding table. |
int |
getIndexInDocument()
Gets the original zero-based index of the corresponding table as per the source document.
|
java.lang.String |
getName()
Gets the name of this table used to access the table's data in a template document passed to
DocumentAssembler. |
void |
setName(java.lang.String value)
Sets the name of this table used to access the table's data in a template document passed to
DocumentAssembler. |
public DocumentTable(java.lang.String documentPath,
int indexInDocument)
throws java.lang.Exception
DocumentTableOptions.documentPath - The path to a document containing the table to be accessed.indexInDocument - The zero-based index of the table in the document.java.lang.Exceptionpublic DocumentTable(java.lang.String documentPath,
int indexInDocument,
DocumentTableOptions options)
throws java.lang.Exception
documentPath - The path to a document containing the table to be accessed.indexInDocument - The zero-based index of the table in the document.options - A set of options controlling extraction of data from the table. If null, default options are applied.java.lang.Exceptionpublic DocumentTable(java.io.InputStream documentStream,
int indexInDocument)
throws java.lang.Exception
DocumentTableOptions.documentStream - The stream containing a document with the table to be accessed.indexInDocument - The zero-based index of the table in the document.java.lang.Exceptionpublic DocumentTable(java.io.InputStream documentStream,
int indexInDocument,
DocumentTableOptions options)
throws java.lang.Exception
documentStream - The stream containing a document with the table to be accessed.indexInDocument - The zero-based index of the table in the document.options - A set of options controlling extraction of data from the table. If null, default options are applied.java.lang.Exceptionpublic java.lang.String getName()
DocumentAssembler.
If the table's name is read from a document, the name is automatically corrected so that it to be valid. However, if the table's name is set manually through this property and the name is invalid, an exception is thrown.
The table's name is considered to be valid, if the following conditions are met:
DocumentTableSet object does not contain a DocumentTable instance with the same name.
DocumentAssembler.public void setName(java.lang.String value)
DocumentAssembler.
If the table's name is read from a document, the name is automatically corrected so that it to be valid. However, if the table's name is set manually through this property and the name is invalid, an exception is thrown.
The table's name is considered to be valid, if the following conditions are met:
DocumentTableSet object does not contain a DocumentTable instance with the same name.
value - The name of this table used to access the table's data in a template document passed to DocumentAssembler.public int getIndexInDocument()
IDocumentTableLoadHandler implementation provided, this index may differ from the index of this DocumentTable instance within the table collection of the corresponding DocumentTableSet instance, if any.public DocumentTableColumnCollection getColumns()
DocumentTableColumn objects representing columns of the corresponding table.DocumentTableColumn objects representing columns of the corresponding table.
See Also:
GroupDocs.Assembly for Java Documentation - the home page for the GroupDocs.Assembly for Java Product Documentation.
GroupDocs.Assembly for Java Support Forum - our preferred method of support.
© 2001-2023 Aspose Pty Ltd. All rights reserved.