Code Tips

The free code tips, advice and tricks contained here are for the programme developer. The information contained here will help improve your programme skills. lets code less, code better. 

Our target: Small tips, solve big problems.
RSS-2.0
  • Export dataset into Excel with unicode support using xml

    I want to export dataset data into excel with number, date format support, but I do not want to install Excel in my server. I donot have the licences. here is the code for you. the following code use xml to handle the excel. Imports Microsoft.VisualBasic Imports System.Data Imports System.IO Public Class WorkBookEngine     Public Sub CreateWorkbook(ByVal dt As DataTable, ByVal Filename As String)        ...

    Read more...
    12/30/2007 10:16:00 PM Category Excel Tips
  • Import into Excel using CSV File having Unicode Data Options

    I am facing a small prblem with Excel and Unicode Data. I am writing data into a CSV file from the database with VB.NET using a Stream Writer object with UTF8 Encoding. This data is Unicode data with Chinese characters with UTF8 encoding. When I open it in Excel (office XP) it does not show the Chinese characters properly, they are converted into ASCII Characters.

    Read more...
    12/11/2007 4:17:00 AM Category .Net
  • Export CSV with unicode content

    You've got an encoding issue. The default encoding for StreamWriter is UTF8NoBOM. That encoding should properly encode Unicode characters. Your problem is likely located in the app you use to read the file. Maybe you can egg it into interpreting the file properly if it contains a BOM (byte order mark). Construct it like this:

    new System.IO.StreamWriter(fileName, Encoding.UTF8);

    Read more...
    12/11/2007 2:49:00 AM Category .Net