MindFusion.Wpf Pack Programmer's Guide
Importing

Importing from CSV

To import a worksheet from an CSV (comma-separated values) file, create an instance of the CsvImporter class, set the appropriate properties and call the Import method. The Quote and Separator properties can be used to specify the quote and separator characters respectively in the imported file. The CsvImportForm (found in the MindFusion.Spreadsheet.Wpf.StandardForms.dll assembly) can be used to facilitate the import from CSV.

The following example illustrates how to import a worksheet from an CSV file:

C#  Copy Code

var csvImporter = new CsvImporter();
csvImporter.Import(worksheet, @"d:\mysheet.csv");

Visual Basic  Copy Code

Dim csvImporter As New CsvImporter()
csvImporter.Import(worksheet, "d:\mysheet.csv")

Importing from ODS Files

To import a workbook from an ODS (OpenDocument) file, create an instance of the CalcImporter class and call the Import method. The following example illustrates how to do this:

C#  Copy Code

var calcImporter = new CalcImporter();
calcImporter.Import(workbook, @"d:\mysheet.ods");

Visual Basic  Copy Code

Dim calcImporter As New CalcImporter()
calcImporter.Import(workbook, "d:\mysheet.ods")

Importing from XLSX Files

To import a workbook from an XLSX (Office Open XML) file, create an instance of the ExcelImporter class and call the Import method. The following example illustrates how to do this:

C#  Copy Code

var excelImporter = new ExcelImporter();
excelImporter.Import(workbook, @"d:\mysheet.xlsx");

Visual Basic  Copy Code

Dim excelImporter As New ExcelImporter()
excelImporter.Import(workbook, "d:\mysheet.xlsx")