การ Export ข้อมูลลง Excel โดยที่เราสามารถสร้าง Sheet ขึ้นมาแบบ Dynamic สามารถใช้ Syncfusion (ไม่ฟรีนะ) จัดการได้ง่ายๆ ทั้งการลงข้อมูลแต่ละเซลล์และสร้าง Sheet ใหม่ได้ง่ายๆ ตัวอย่างที่ให้ดูจะสามารถ Copy Template จากอีกไฟล์มาได้ด้วย
	Imports Syncfusion.XlsIO
	Imports System.IO
	Partial Class test_test_excel
	    Inherits System.Web.UI.Page
	    Protected Sub RadButton1_Click(sender As Object, e As EventArgs) Handles RadButton1.Click
	        
	        Dim templatePath As String = Server.MapPath("~/test/template/")
	        Dim outputPath As String = Server.MapPath("~/test/output_excel/")
	        Dim templateFile As String
	        templateFile = templatePath + "ExportBudget.xlsx"
	        Dim templateFile_copy As String
	        templateFile_copy = templatePath + "ExportBudgetCopy.xlsx"
Dim outFile As String = outputPath + Format(Now, "ddMMyyhhmmssfff") + ".xls"
	        Dim excelEngine As New ExcelEngine()
	        Dim application As IApplication = excelEngine.Excel
	        Dim workbook As IWorkbook = Nothing
	        Dim workbook_copy As IWorkbook = Nothing
	        'open template file
	        workbook = application.Workbooks.Open(templateFile)
	        workbook_copy = application.Workbooks.Open(templateFile_copy)
	        workbook.Worksheets.AddCopy(workbook_copy.Worksheets(0))   'Copy  Template ที่เตรียมไว้มาใช้เป็น Sheet ต่อไป
	        workbook.Worksheets(1).Name = "new Sheet"
	        Dim sheet As IWorksheet = Nothing
	        sheet = workbook.Worksheets(1) 
	       
	        'row 1,2,3
	        'column  1,2,3
	        For row_index = 2 To 5
	            sheet.SetValueRowCol("หัวข้อรายงาน ", 2, 1)
	            sheet.SetValueRowCol("xxxxx", 3, 1)
	            sheet.SetValueRowCol("yyyyy", 4, 2)
	            sheet.SetValueRowCol("zzzzz", 4, 6)
	            row_index += 1
	        Next
	        'save fies
	        workbook.SaveAs(outFile)
	        Dim fileexp As String = "ExportBudget.xls"
	        'output file as download
	        HttpContext.Current.Response.Clear()
	        HttpContext.Current.Response.AddHeader("content-disposition", String.Format("attachment; filename={0}", fileexp))
	        HttpContext.Current.Response.ContentType = "application/ms-excel"        HttpContext.Current.Response.WriteFile(outFile)
	        HttpContext.Current.Response.[End]()       
	    End Sub       
	End Class
	การทำงานก็จะได้ไฟล์ดาวน์โหลดออกมาเป็น Excel เลย
	