Wednesday, July 16, 2014

Export to Excel in C#.Net

Sample Export to Excel from C#.Net

using System;
using System.Collections.Generic;
using System.Windows.Forms;
using CarlosAg.ExcelXmlWriter;

public class ExportData
{
 [STAThread]
 public void ExportToExcel()
 {
  Workbook book = new Workbook();
  Worksheet sheet = book.Worksheets.Add("Sheet1"); 
  WorksheetRow row =  sheet.Table.Rows.Add(); 
  row.Cells.Add("Hello World");
  book.Save(@"D:\Test1.xls");
 }
}

No comments:

Post a Comment