This module allows easy to write/read excel files to DataSet using OpenXml under the hood and supports MS Orleans ver. 3.2 and higher.
Please feel free to fork and submit pull requests to the develop branch.
Supported file formats and versions
| Extension | Excel Version(s) |
|---|---|
| .xlsx | 2007 and newer |
| .xls | 2003, and newer |
| .csv | Only with the comma separator |
Install-Package ExcelDocumentsModule -Version 1.0.0
/// "ReadDocument" method has bool parameter "isFirstRowHeader" which works only with .xls and .xlsx files.
/// CSV files always use the comma separator to define the first row as a header inside the DataSet.
var excelModule = new ExcelModule();
var filePath = "../Some/Directory/FileName.xlsx";
var dataSet = excelModule.ReadDocument(filePath);
var excelModule = new ExcelModule();
var outputFilePath = "../Some/Directory/FileName.xlsx";
var dataSetToFile = new DataSet();
//...
// Adding some data to dataSetToFile...
//...
excelModule.WriteDocument(dataSetToFile, outputFilePath);
Just replace new ExcelModule(); or container.Resolve<IExcelModule>(); to client.GetGrain<IExcelModuleOrleans>(Guid.NewGuid()); where the client is IClusterClient.
For more information look at the tests projects.