Analyzing your prompt, please hold on...
An error occurred while retrieving the results. Please refresh the page and try again.
Developers can import data from an ArrayList to their worksheets by calling the ImportArrayList method of the Cells collection. The ImportArrayList method takes the following parameters: ArrayList, which represents the ArrayList object whose contents need to be imported.
//Instantiating a Workbook object
Workbook workbook = new Workbook();
//Adding a new worksheet to the Workbook object
int i = workbook.Worksheets.Add();
//Obtaining the reference of the newly added worksheet by passing its sheet index
Worksheet worksheet = workbook.Worksheets[i];
//Instantiating an ArrayList object
ArrayList list = new ArrayList();
//Add a few names to the list as string values
list.Add("laurence chen");
list.Add("roman korchagin");
list.Add("kyle huang");
list.Add("tommy wang");
//Importing the contents of ArrayList to 1st row and first column vertically
worksheet.Cells.ImportArrayList(list, 0, 0, true);
//Saving the Excel file
workbook.Save("DataImport from Array List.xls");
Analyzing your prompt, please hold on...
An error occurred while retrieving the results. Please refresh the page and try again.