0

Below is my sample VB.Net code to generate CSV file but I don't find a way to specify UTF-8 encoding. Can anyone help me on this?

Public Sub GenerateCsvFile(ByVal dt As DataTable, ByVal strFilePath As String)

    Dim workbook As SpreadsheetGear.IWorkbook
    Dim worksheet As SpreadsheetGear.IWorksheet

    workbook = SpreadsheetGear.Factory.GetWorkbook()
    worksheet = workbook.Worksheets("Sheet1")
    Dim cells As SpreadsheetGear.IRange
    cells = worksheet.Cells("A1")
    cells.CopyFromDataTable(dt, Data.SetDataFlags.AllText)
    workbook.SaveAs(strFilePath, SpreadsheetGear.FileFormat.CSV)
    worksheet = Nothing
    workbook.Close()
    workbook = Nothing
End Sub

Note: The below link which is similar question asked in 2015 and I was wondering with the latest dll has the solution for this

VInayK
  • 1,501
  • 6
  • 34
  • 47
  • Does this answer your question? [Is there any way to specify the encoding used in SpreadsheetGear to generate CSV files?](https://stackoverflow.com/questions/29212241/is-there-any-way-to-specify-the-encoding-used-in-spreadsheetgear-to-generate-csv) – djv Nov 27 '19 at 17:39
  • the post is from 2015 and I was wondering in latest version of dll has this feature – VInayK Dec 05 '19 at 21:25

0 Answers0