ReoGrid supports the following file formats:

FormatRead WorkbookWrite WorkbookRead WorksheetWrite Worksheet
Excel 2007 (Open Office XML, .xlsx)YesYes
RGF (ReoGrid Format, XML-based)YesYesYesYes
CSVYesYes
HTMLYes

FileFormat Enum

using unvell.ReoGrid.IO;
ValueDescription
FileFormat.Excel2007Excel 2007+ Open XML format (.xlsx)
FileFormat.ReoGridFormatReoGrid native format (XML-based, .rgf)
FileFormat.CSVComma-separated values

Workbook Load / Save

Load

// Auto-detect format from file extension
grid.Load("file.xlsx");

// Specify format explicitly
grid.Load("file.xlsx", FileFormat.Excel2007);

// From a stream (format required)
grid.Load(stream, FileFormat.Excel2007);

// With encoding
grid.Load(stream, FileFormat.CSV, Encoding.UTF8);

Load Overloads

SignatureDescription
Load(string path)Load from file, format detected from extension
Load(string path, FileFormat format)Load from file with explicit format
Load(string path, FileFormat format, Encoding encoding)Load with encoding
Load(Stream stream, FileFormat format)Load from stream
Load(Stream stream, FileFormat format, Encoding encoding)Load from stream with encoding

Save

// Auto-detect format from file extension
grid.Save("output.xlsx");

// Specify format explicitly
grid.Save("output.xlsx", FileFormat.Excel2007);

// To a stream (format required)
grid.Save(stream, FileFormat.Excel2007);

Save Overloads

SignatureDescription
Save(string path)Save to file, format detected from extension
Save(string path, FileFormat format)Save to file with explicit format
Save(string path, FileFormat format, Encoding encoding)Save with encoding
Save(Stream stream, FileFormat format)Save to stream
Save(Stream stream, FileFormat format, Encoding encoding)Save to stream with encoding

Worksheet-Level Load / Save (RGF Only)

For the RGF format, you can save and load individual worksheets:

// Save a single worksheet
sheet.SaveRGF("sheet1.rgf");
sheet.SaveRGF(stream);

// Load into a single worksheet
sheet.LoadRGF("sheet1.rgf");
sheet.LoadRGF(stream);

See RGF Format for details on multi-worksheet patterns.

Events

EventDescription
WorkbookLoadedRaised after a workbook file is loaded
WorkbookSavedRaised after a workbook file is saved

Excel vs RGF Format

To learn about the differences between the Excel and RGF formats, see Difference between Excel and RGF format.

Was this article helpful?