Last post Feb 05, 2016 03:04 AM by Yohann Lu
Nov 09, 2011 09:35 PM|AzharSaiyed|LINK
I have repeater, now i want to Export into CSV file.
I can't use Gridview because HTML of my repeater is little bit complex.
Please sujjest me how can i export into CSV?
Feb 03, 2016 10:39 AM|bhargav5126|LINK
Look into below link and follow step by step tutorial and also have demo to check in detail.
Feb 05, 2016 03:04 AM|Yohann Lu|LINK
According to your description, You can refer to the following ideas. You can dynamically generate a table from your repeater. Then, you can refer the following method to export a csv file.
private void Export()
Response.ContentType = "Application/x-msexcel";
private string ExportToCSVFile(DataTable dtTable)
StringBuilder sbldr = new StringBuilder();
if (dtTable.Columns.Count != 0)
foreach (DataColumn col in dtTable.Columns)
sbldr.Append(col.ColumnName + ',');
foreach (DataRow row in dtTable.Rows)
foreach (DataColumn column in dtTable.Columns)
sbldr.Append(row[column].ToString() + ',');