2.2.4.46 Worksheet

Contents

Name

Worksheet

Remark

The Worksheet class provides methods and properties common to worksheet layers in Origin worksheet pages. An Origin worksheet may contain a number of worksheet columns thus the Worksheet class contains a collection of all the columns in the worksheet.

An Origin C Worksheet object is a wrapper object that is a reference to an internal Origin worksheet object. Origin C wrapper objects do not actually exist in Origin and merely refer to the internal Origin object. Consequently, multiple Origin C wrapper objects can refer to the same internal Origin object.

The Worksheet class is derived from the Datasheet, Layer, and OriginObject classes from which it inherits methods and properties.

Hierarchy

Examples

EX1

// Delete all the columns in the active worksheet.
int Worksheet_Worksheet_Ex1()
{
    Worksheet wks = Project.ActiveLayer();
    if(wks)
    {
        out_int("Number of columns to be deleted = ", wks.GetNumCols());
        // The following loop will continue until it fails to delete the first
        // column in the worksheet.  Each time the first column is deleted the
        // other columns are shifted left causing the second column to become
        // the first column.
        while(wks.DeleteCol(0));
    }
    else
        out_str("The active window is not a worksheet.");
    return 0;
}

EX2

// Access a specific sheet in a specific book
void Worksheet_Worksheet_Ex2()
{
    Worksheet wks("[Book2]Sheet3");
    if(wks)
    {
    	int nR1, nR2;
    	wks.GetBounds(nR1, 0, nR2, -1);// need to convert to LabTalk indexing by +1
	    printf("Worksheet [%s]%s has %d rows of data\n", wks.GetPage().GetName(), wks.GetName(), nR2+1);
    }
    else
        out_str("No such sheet");
}

Header to Include

origin.h

Reference

Members

Name Brief Example
Add a new column to the worksheet
Append rows to the worksheet
Attaches a Image File to Worksheet cell
Autosizing worksheet
Autosizing height of worksheet row, both for data rows and label rows
Check if a label of the given type already exists among headers. If yes, it will just return its position. If not, it will be added and its position will be returned.
Clear content of a label of the given type.
Access the Columns collection by index
Copy data to another worksheet with optional row shift
Create a copy of an existing worksheet
Do cross tabulation
Delete a column in the worksheet
Delete a range of data in the worksheet
Delete a row in the worksheet
Delete rows in the worksheet
Deletes the current selection from a worksheet.Deletes the current selection from a worksheet.
Detach any graph that is attached to a given Worksheet cell
Retrieves an embedded page by index
Attaches a graph to Worksheet cell
Attaches a matrix to Worksheet cell
Attaches a Note to Worksheet cell
Export worksheet to an ASCII file
Extracts a Worksheet to a new or an existing worksheet
Vector extraction from a column with grouping information
Starting from a given column index, find a column with the required designation. The column returned could be the first or last found, dependending on the options, and the search could go to the left or to the right.
Get the internal ASCII import settings for the worksheet. The settings will be returned in an ASCIMP structure. The ASCIMP structure is defined and documented in the oc_types.h header file.
Get the minimum beginning and maximum ending row indices for the specified columns in this Worksheet.
Get cell value as a string
Get cell comment as a string
Get list of cells with Notes
Get the column designations for a worksheet in string form
Gets the column formats of all the columns in the worksheet
Create a curve object based on two datasets
Provides access to all embedded graphs
Gets embedding parameters if there is an embedding at the cell identified by nRow, nCol and dwEmbedParams
Get all rows/columns hide status.
Provides Label row index for a given Label type ID
Provides Label type ID for a given Label index
Returns number of embedded pages.
Use to get the existing printing area. Pass NULL to test if printing area exist.
Get the beginning and ending row indices for the specified columns in this Worksheet. This is an improved version of GetBounds with more detailed controls on handling of missing and text values
Worksheet script getting
Fill a vector with column indexes where column is completely or partially selected
Retrieves the current selection from the worksheet
Retrieves the current selection from the worksheet.
Checks if worksheet has any kind of embedding, graph, note, image etc.
Hides labels of the given type (if the label of that type is shown).
Insert column(s) in the worksheet.
Insert an empty row in the worksheet
Reveal if vertical (Column) or horizontal (Row) grid lines are being shown in a worksheet
Determine if Row or Column Headers are shown
Checks if worksheet is holder sheet
Determines if Row Header Labels are displayed or not
Returns TRUE or FALSE depending on whether the label of the given type is shown or not.
Check the worksheet's selected range whether has write protected column or not.
Get/Set label rows' dynamic merge state.
Provides categorical information for the worksheet
Open a new worksheet from the supplied OGW file and attaches it to the object.
Paste specified, tab-delimited text into a worksheet
Put data from a recordset into an Origin worksheet
Put the data from an SPC blob into the worksheet.
Read data from a recordset into worksheet
Remove embeddings at a given Worksheet cell
Reorder the rows of worksheet with specified orders
Reorder the columns of worksheet with specified orders
Run enable data filters in the worksheet
Select rows from worksheet based on a LabTalk condition expression
Extract target label from source label row.
Set the internal ASCII import settings for the worksheet. The settings will be passed in an ASCIMP structure. The ASCIMP structure is defined and documented in the oc_types.h header file.
Sets whether worksheet as holder sheet.
Sets a row of the worksheet to a label of the given type.
Set the begining and ending row indices for the specified columns in this Worksheet.
Put a group of values into a row in worksheet


Set cell comment
Used to apply designation pattern to an entire worksheet
Sets the column formats in a worksheet.
Sets embedding parameters if there is an embedding at the cell identified by nRow, nCol and dwEmbedParams
Many operations in Origin, like plotting and some analysis routines can run faster if a column is set to be evenly spaced. Set a column or all columns in worksheet to be evenly spaced so there is no to use X column
Set the beginning row indices for the specified columns in the Worksheet.
Use to set printing area. Pass NULL to clear existing printing area.
Set the beginning and ending row indices for the specified columns in this Worksheet.
Worksheet script setting
Highlight ranges as selected specified by input row and column indices
Set the number of columns and rows of worksheet
Set the ending row display index for the specified columns in this Worksheet. Index values are 0 based offset.
Show or hide column.
Show or Hide the display of vertical (Column) or horizontal (Row) grid lines in a workbook
Show or hide the Row or Column headers.
Show or hide display of row header labels
Show or hide column labels


Show or hide row
Sort the specified columns in a worksheet in ascending or descending order based on the values in the specified column number. All column and row numbers are 0 based offsets.
Sort columns by row content.
This function stack columns by plot designation. Each column designation is unique in each combination.When there is a missing column in front/middle of the combination, repeat the column from last combination. Note:disregardful columns would be ignore
Dump the contents of the worksheet into the designated target window.
Updates the underlying Origin worksheet from Excel
Construct a worksheet object and attach to named worksheet window
Write worksheet data into recordset

Property

Name Brief Example
The Collection of all Columns in a Worksheet
A Collection of all Embedded Pages in a Worksheet