DocumentTools[Components] - Maple Programming Help

Online Help

All Products    Maple    MapleSim


Home : Support : Online Help : Programming : Document Tools : Components : DocumentTools/Components/DataTable

DocumentTools[Components]

  

DataTable

  

generate XML for a DataTable Component

 

Calling Sequence

Parameters

Options

Description

Examples

Compatibility

Calling Sequence

DataTable( opts )

Parameters

opts

-

(optional); one or more keyword options as described below

Options

• 

action : string; A string which parses to one or more valid statements in 1D Maple Notation.

• 

identity : {name,string}; The reference name of the component.

• 

columnheader : truefalse; Specifies whether column names will be shown. The default is false.

• 

columnnames : list({scalar,string}); A list of headers for each column.

• 

columnwidths : list(posint); A list of positive integers specifying the width in pixels of the columns.

• 

enabled : truefalse; Specifies whether the component is enabled. The default is true.

If enabled is false then an inserted DataTable will not receive updates when the associated Matrix or Vector changes.

• 

editable : truefalse; Specifies whether component entries may be edited. The default is true.

• 

rowheader : truefalse; Show the row names. The default is true.

• 

rownames : list({scalar,string}); A list of headers for each row.

• 

tooltip : string; The text that appears when the mouse pointer hovers over the DataTable.

• 

variable : name; The name of the associated Matrix or Array.

• 

visible : truefalse; Specifies whether the component is visible. The default is true.

• 

visiblerows : posint; The number of rows that are displayed.

• 

visiblecolumns : posint; The number of columns that are displayed.

Description

• 

The DataTable command in the Component Constructors package returns an XML function call which represents a DataTable Component.

• 

The generated XML may be used with the results of commands in the Layout Constructors package to create an entire Worksheet or Document in XML form. Such a representation of a Worksheet or Document may be inserted into the current document using the InsertContent command.

Examples

with(DocumentTools:-Components):

with(DocumentTools:-Layout):

M := Matrix(3,3,[[1,3,2.7],[5,Pi,sin(x)],[a,b,1.0/3]]);

M132.75πsinxab0.3333333333

(1)

Executing the DataTable command produces a function call.

DT := DataTable(identity = "DataTable0", variable = 'M');

DT_XML_EC-RTableBrowserid=DataTable0,columnheader=false,editable=true,enabled=true,handle=18446883746370962726,rowheader=false,variable=M,visible=true,visiblecolumns=3,visiblerows=3

(2)

By using commands from the DocumentTools:-Layout package a nested function call can be produced which represents a worksheet.

xml := Worksheet(Group(Input(Textfield( DT )))):

That XML representation of a worksheet can be inserted directly.

DocumentTools:-InsertContent(xml):

DT := DataTable( identity = "DataTable0", variable = 'M',
                 rowheader, columnheader,
                 columnnames = [A, "Col. B", 3], columnwidths = [25, 50, 100],
                 rownames = [x, y, z],
                 tooltip = "my data table" ):

xml := Worksheet(Group(Input(Textfield( DT )))):

DocumentTools:-InsertContent(xml):

By using the right-click context-menu item Edit Content Changed Action of the DataTable Component its associated action code may be viewed or edited. If the enabled property of the DataTable Component is set then that action code is executed whenever its entries are changed manually. Note that assigning to an entry of the associated Vector/Matrix/Array will not cause execution of the action code.

Compatibility

• 

The DocumentTools[Components][DataTable] command was introduced in Maple 2015.

• 

For more information on Maple 2015 changes, see Updates in Maple 2015.

See Also

Component Code

Component Constructors

DocumentTools

Embedded Components

XMLTools