Show / Hide Table of Contents

    IDwDataExporter.Export(bool colheading = true) Method

    .NET Standard 2.x

    Exports data from the DataStore primary buffer in the specified DataFormat, and specifies whether to include columns heading.

    Namespace: DWNet.Data

    Assembly: DWNet.Data.dll

    Syntax

    string Export(bool colheading = true);
    

    Parameters

    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 to a JSON string with 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 Example1()
            {
                // 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(true);
    
                Console.WriteLine(json);
    
                /*The exported JSON file is:
    
                ExportJson1.json
                */
            }
        }
    }
    

    Example Refer To

    Model Class: D_Department
    JSON File: ExportJson1
    DataWindow File: d_department

    Back to top Generated by Appeon