Spread WPF 14
Spread WPF Documentation / Developer's Guide / Managing Data / Importing and Exporting CSV Files
In This Topic
    Importing and Exporting CSV Files
    In This Topic

    GcSpreadSheet has additional settings that are available when saving or loading CSV files. You can only save or load text, include row or column headers, save or load unformatted values, export or import formulas, and set the encoding.

    You can use the OpenCsv or SaveCsv method in code.

    Using Code

    The following example uses the OpenCsv and SaveCsv methods to open and save a file.

    CS
    Copy Code
    // gcSpreadSheet1.Sheets[0].SaveCsv("c:\\zipfile\\test.csv", GrapeCity.Windows.SpreadSheet.Data.TextFileSaveFlags.AsViewed);
    gcSpreadSheet1.Sheets[0].OpenCsv("c:\\zipfile\\test.csv", GrapeCity.Windows.SpreadSheet.Data.TextFileOpenFlags.None);
    gcSpreadSheet1.Invalidate();
    
    VB.NET
    Copy Code
    'GcSpreadSheet1.Sheets(0).SaveCsv("c:\zipfile\test.csv", GrapeCity.Windows.SpreadSheet.Data.TextFileSaveFlags.AsViewed)
    GcSpreadSheet1.Sheets(0).OpenCsv("c:\zipfile\test.csv", GrapeCity.Windows.SpreadSheet.Data.TextFileOpenFlags.None)
    GcSpreadSheet1.Invalidate()
    
    See Also