2.2.4.24.2 Layer::CreateLinkTable

Description

Insert a table object

Syntax

GraphObject CreateLinkTable( LPCSTR lpcszName = NULL, Worksheet & wks = NULL, int nTable = -1, DWORD dwCntrl = 0 )

Parameters

lpcszName
[input] name of the object, typically using the linked worksheet page's short name
wks
[input] the linked worksheet, NULL will create a table without a linked worksheet
nTable
[input] index of a subtable if wks is a Hierarchy sheet (0 offset), otherwise this valid is ignore as a flat sheet is considered a single table
dwCntrl
[input] additional control bits like CLTBL_NO_FIRE_EVENT tp disable Origin C event to apply a system theme.

Return

returns the newly created table object

Examples

EX1

//Insert a  table object in the active graph layer.
void Layer_CreateLinkTable_ex1()
{
    GraphLayer gl = Project.ActiveLayer();
    if(gl)
    {
        Worksheet wks;
        wks.Create("Table", CREATE_HIDDEN);
        WorksheetPage wp = wks.GetPage();
        wp.Rename("Table1");
        wks.SetSize(5, 3);
        GraphObject grTable = gl.CreateLinkTable(wp.GetName(), wks);
    }
}

Remark

See Also

Header to Include

origin.h