YGMSExcelBeater 1.0.1
See the version list below for details.
dotnet add package YGMSExcelBeater --version 1.0.1
NuGet\Install-Package YGMSExcelBeater -Version 1.0.1
<PackageReference Include="YGMSExcelBeater" Version="1.0.1" />
paket add YGMSExcelBeater --version 1.0.1
#r "nuget: YGMSExcelBeater, 1.0.1"
// Install YGMSExcelBeater as a Cake Addin #addin nuget:?package=YGMSExcelBeater&version=1.0.1 // Install YGMSExcelBeater as a Cake Tool #tool nuget:?package=YGMSExcelBeater&version=1.0.1
README
What is this repository for?
This class libary uses NPOI to read and write to excel file with c# .net 6 and above. It has internal mapper to map the contents of Excel sheet to a generic collection List<T>. As long as the property names match the field names in the excel file
How do I get set up?
The Excel file must have a header to hold the field names. The field names must not have spaces or special characters All field names must be reproducable in the DTO where the records are mapped to
Sample setup: (Excel containing a key field in column 0 "L-2" being one of the unique values )
string excelFileName = "C:\Temp\TestData.xlsx";
// Constructor takes filename, sheet number, and column number for the key, or, column name using (IMSExcelBeater beater = new MSExcelBeater(excelFileName, 0, 0)) // first parm: filename, second parm: sheet number. Third parm: key column number or name { string title = beater.Get("L-2", "title"); // This is to get a value from column "title" row key number "L-2" string result1 = beater.Update("L-2", "title", "bloon"); // This is to update the value in column "title" row key number "L-2" string result2 = beater.Save(); // This is to save all the updates
List<TestDTO> allData = beater.GetAllData<TestDTO>(); // This is to retrieve the entire sheet into a generic collection
string[] fieldNames = beater.GetAllFieldNames(); // This is to retreve all field names in the excel file
}
Contribution guidelines
- Writing tests
- Code review
- Other guidelines
Who do I talk to?
- Repo owner or admin
Product | Versions Compatible and additional computed target framework versions. |
---|---|
.NET | net6.0 is compatible. net6.0-android was computed. net6.0-ios was computed. net6.0-maccatalyst was computed. net6.0-macos was computed. net6.0-tvos was computed. net6.0-windows was computed. net7.0 was computed. net7.0-android was computed. net7.0-ios was computed. net7.0-maccatalyst was computed. net7.0-macos was computed. net7.0-tvos was computed. net7.0-windows was computed. net8.0 was computed. net8.0-android was computed. net8.0-browser was computed. net8.0-ios was computed. net8.0-maccatalyst was computed. net8.0-macos was computed. net8.0-tvos was computed. net8.0-windows was computed. |
-
net6.0
- Newtonsoft.Json (>= 13.0.3)
- NPOI (>= 2.7.1)
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.
Initial Release - Read a record, read entire sheet, update a cell in Excel file