Created
August 8, 2011 16:58
-
-
Save MikeHook/1132183 to your computer and use it in GitHub Desktop.
EPPlus LoadFromArrays Example
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
string firstName = "Bob"; | |
string lastName = "Burton"; | |
DateTime dateOfBirth = new DateTime(2000, 1, 1); | |
var testData = new List<object[]>() | |
{ | |
new object[] {"First name", firstName}, | |
new object[] {"Last name", lastName}, | |
new object[] {"Date of birth", dateOfBirth} | |
}; | |
using (var excelPackage = new ExcelPackage()) | |
{ | |
ExcelWorksheet excelWorksheet = excelPackage.Workbook.Worksheets.Add("Test worksheet"); | |
//Load the summary data into the sheet, starting from cell A1. Print the column names on row 1 | |
excelWorksheet.Cells["A1"].LoadFromArrays(testData); | |
} |
Thank you for the information, very helpful.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
This gives 7 column data with additional data column which are unnesessary...