Show / Hide Table of Contents

    IDwDataExporter.Export(int startRow, int endRow, int startColumn, int endColumn, bool colheading = true) Method

    .NET Standard 2.x

    Exports data from the DataStore primary buffer in the specified DataFormat, and specifies the start and end positions of the rows and columns, and whether to include columns heading.

    Namespace: DWNet.Data

    Assembly: DWNet.Data.dll

    Syntax

    string Export(int startRow, int endRow, int startColumn, int endColumn, bool colheading = true);
    

    Parameters

    startRow System.Int32

    The zero-based index number of the first row in the buffer that you want to export.

    endRow System.Int32

    The zero-based index number of the last row in the buffer that you want to export.

    If it is negative, it indicates the rest of rows.

    startColumn System.Int32

    The zero-based index number of the first column in the buffer that you want to export.

    If it is negative, 0 is used.

    endColumn System.Int32

    The zero-based index number of the last column in the buffer that you want to export.

    If it is negative, it indicates the rest of columns.

    colheading System.Boolean

    Specify whether the exported data contains column heading.

    Returns

    System.String

    Data string in the specified format.

    Reference DataWindow JSON Plain JSON

    Examples

    The following code example demonstrates how to export the department records in the first row and first column to a JSON string without column headings.

    using SnapObjects.Data;
    using DWNet.Data;
    using System;
    
    namespace Appeon.ApiDoc.IDwDataExporterExamples
    {
        public class ExportExample
        {
            private readonly SchoolContext _context;
    
            public ExportExample(SchoolContext dataContext)
            {
                // Sets the data context
                _context = dataContext;
            }
    
            public void Example3()
            {
                // Instantiates a DataStore object with datawindow: d_department.
                var datastore = new DataStore("d_department", _context);
    
                datastore.Retrieve();
    
                // Get DataStore exporter in JSON format.
                var exporter = datastore.GetDataExporter(DataFormat.Json);
                string json = exporter.Export(0, 0, 0, 0, false);
    
                Console.WriteLine(json);
    
                /*This code produces the following output:
    
                [{"Departmentid":1}]
                */
            }
        }
    }
    

    Example Refer To

    Model Class: D_Department
    DataWindow File: d_department

    Back to top Generated by Appeon