make file excel(*.xls) from vb .NET 2003
-
There are many ways. _Using OLE Automation _Using thirst party component: Aspose, FarPoint... _Make it yourself
not helpful at all
When you get mad...THINK twice that the only advice Tamimi - Code
-
Here is a simple app that takes a dataset and writes a worksheet per data table in the set Public Sub writeToExcel(ByVal source As DataSet) Dim doc As New System.IO.StreamWriter("Excel.xls") 'use .xls even though its an xml file Dim startExcelXML As String = "" startExcelXML &= "" startExcelXML &= vbNewLine & "" 'write the styles tags that format the data and cells properly startExcelXML &= vbNewLine & "" startExcelXML &= vbNewLine & " " startExcelXML &= vbNewLine & " <Alignment ss:Vertical=""Bottom""/>" startExcelXML &= vbNewLine & " <Borders/>" startExcelXML &= vbNewLine & " <Font/>" startExcelXML &= vbNewLine & " <Interior/>" startExcelXML &= vbNewLine & " <NumberFormat/>" startExcelXML &= vbNewLine & " <Protection/>" startExcelXML &= vbNewLine & " " startExcelXML &= vbNewLine & "" startExcelXML &= vbNewLine & "<Alignment ss:Horizontal=""Center"" ss:Vertical=""Bottom""/>" startExcelXML &= vbNewLine & "<Font x:Family=""Swiss"" ss:Size=""8"" ss:Bold=""1""/>" startExcelXML &= vbNewLine & "<Interior ss:Color=""#C0C0C0"" ss:Pattern=""Solid""/>" startExcelXML &= vbNewLine & "" startExcelXML &= vbNewLine & " " startExcelXML &= vbNewLine & " <Font " + "x:Family=""Swiss"" ss:Bold""0""/>" startExcelXML &= vbNewLine & " " startExcelXML &= vbNewLine & "" 'write the header to the file doc.WriteLine(startExcelXML) 'write one sheet per table For Each tab As DataTable In source.Tables Dim sheetname As String = "" doc.WriteLine(sheetname) doc.WriteLine("") 'write t
-
not helpful at all
When you get mad...THINK twice that the only advice Tamimi - Code
Neither was the question...
Dave Kreskowiak Microsoft MVP - Visual Basic