ExcelReportsGenerator generator = new ExcelReportsGenerator(); //Trial Mode
//ExcelReportsGenerator generator = new ExcelReportsGenerator("place user name here", "place license key here"); //License Mode
//Parameters
string filePath = "FillWorksheetWithCsvStreamExample.xlsx";
Workbook workbook = generator.WorkbookFactory(filePath);
workbook.Author = "John Smith";
workbook.CreatedTime = DateTime.Now;
workbook.LastSavedBy = "John Smith";
workbook.Subject = "This is a subject";
workbook.Title = "This is a title";
Worksheet worksheet = generator.AddWorksheet(workbook, "Employees");
string csvString = @"FirstName,LastName,Married,NumberOfChildren,Salary,BirthDate
John,Smith,True,3,""$60,000"",12/15/1977
Joe,Jones,False,0,""$30,000"",6/25/1993";
File.WriteAllText("Input.csv",csvString);
using (FileStream csvStream = new FileStream("Input.csv", FileMode.Open, FileAccess.Read))
{
generator.FillFromCsvStream(worksheet, csvStream);
}
generator.SaveWorkbook(workbook);