Last post Feb 19, 2011 01:59 PM by mchinta
Feb 19, 2011 12:52 PM|mchinta|LINK
I have a List<Customer>. Customer class has like 20 properties. I have List<Customer> count 10,000 ROWS.
I want to convert this List<Customer> to Excel format in C# coding ASP.NET Handler Page. Then save it.
If you have any idea, please suggest me.
I will get a EXCEL, i will read it, do some processing and i will need to append columns to each and every customer accordingly, and make a new EXCEL sheet.
Feb 19, 2011 01:06 PM|tatsky|LINK
Why don't you create a CSV file from your collection. You can then have Excel consume that file and you can process it within Excel and save out as an Excel file.
You can create the CSV file by simply looping through the collection and use a StringBuilder to build up the csv file.
I have many Excel reports which pull in data from a website like this and process using VBA Macros. So say for example you have a page in a website which spits out a CSV file, and it is at the URL
In an Excel macro you can do the following
Excel will open the data as an excel file and you can then have your macro do whatever work you want on the data, and save out as an excel workbook.
Does that make sense and help at all?
Feb 19, 2011 01:59 PM|mchinta|LINK
Your idea is good, create CSV then to EXCEL.
My question, is how do we create EXCEL from CSV file in C# coding?