epplus-4

Excel & EPPlus .NET library: Advanced DropDown list validation

末鹿安然 提交于 2019-12-01 02:41:57
问题 In Epplus, when we create a DropDown list for some cells in excel file, then user put a value which is not part of the list, the cell show a message says: value must match one of the listed items. Instead of this message, Is it possible to prevent the user to put a value which is not part of the drop down list? Thanks in advance, 回答1: I did it with the following code: //ExcelWorksheet ws var validation = ws.DataValidations.AddListValidation(cell.Address); //Error handling validation

EPPlus - Read Excel Table

筅森魡賤 提交于 2019-11-30 06:40:15
Using EPPlus, I want to read an excel table, then store all the contents from each column into its corresponding List . I want it to recognize the table's heading and categorize the contents based on that. For example, if my excel table is as below: Id Name Gender 1 John Male 2 Maria Female 3 Daniel Unknown I want the data to store in List<ExcelData> where public class ExcelData { public string Id { get; set; } public string Name { get; set; } public string Gender { get; set; } } So that I can call out the contents using the heading name. For example, when I do this: foreach (var data in

EPPLUS how to know the format of the Worksheet cell

孤者浪人 提交于 2019-11-29 14:52:40
I am using EPPlus to read excel sheets and load the data into datatable to perform further operations and then save back the modified data to the excel file. The below code checks if the cell value is a float value then it converts the float value to datetime. The code works fine when the cell value is a date eg: Invoice Date = 42009 , but it converts the not a date value like eg : amount = 10 to a date. Is there any way in EPPlus library from which i can determine the format of the cell (i.e General/date/number etc) ? float floatValue; if (float.TryParse(Convert.ToString(oSheet.Cells[i, j]

EPPLUS how to know the format of the Worksheet cell

大城市里の小女人 提交于 2019-11-28 09:11:05
问题 I am using EPPlus to read excel sheets and load the data into datatable to perform further operations and then save back the modified data to the excel file. The below code checks if the cell value is a float value then it converts the float value to datetime. The code works fine when the cell value is a date eg: Invoice Date = 42009 , but it converts the not a date value like eg : amount = 10 to a date. Is there any way in EPPlus library from which i can determine the format of the cell (i.e

EPPlus - Read Excel Table

为君一笑 提交于 2019-11-27 14:41:19
问题 Using EPPlus, I want to read an excel table, then store all the contents from each column into its corresponding List . I want it to recognize the table's heading and categorize the contents based on that. For example, if my excel table is as below: Id Name Gender 1 John Male 2 Maria Female 3 Daniel Unknown I want the data to store in List<ExcelData> where public class ExcelData { public string Id { get; set; } public string Name { get; set; } public string Gender { get; set; } } So that I