2.13.3 ClearData


Description

clear all the data in the datasheet

Syntax

VB: Function ClearData([ c1 As ByVal Object ], [ c2 As ByVal Object ] ) As Boolean
C++: bool ClearData(_variant_t c1, _variant_t c2 )
C#: bool ClearData(var c1, var c2 )

Parameters

c1
Beginning Column Index to clear, default 0
c2
Ending Column Index to clear, -1 to indicate to the end as the default

Return

Remark

Examples

VB

    Sub cleardata()
        Dim ds As Origin.Datasheet
        Dim app As Origin.IOApplication

        app = New Origin.ApplicationSI
        ds = app.ActivePage.Layers(-1) 'get active layer of active page
        ds.ClearData(0, -1) ' clear all the data in datasheet
    End Sub

C#

        public void ClearData()
        {
            Origin.IOApplication pOrigin;
            Origin.Datasheet dsht;

            pOrigin = new Origin.ApplicationSIClass();
            pOrigin.Visible = Origin.MAINWND_VISIBLE.MAINWND_SHOW;
            dsht = (Datasheet)pOrigin.ActivePage.Layers[-1]; //get active matrixsheet of worksheet, do make sure active page is MatrixBook or WorkBook
            dsht.ClearData(0, -1); //clear all data on datasheet
        }
        static void Main(string[] args)
        {
            Program p = new Program();
            p.ClearData();
        }

Version Information

8.0SR2

See Also