Computer Problems? Computing.Net has over 1,000,000 posts about all things technology related! Over 90% answered within 24 hours! Click here to start participating now! Also, be sure to check out the New User Guide.
export to excel VB.NET 2
Name: bexm Date: March 31, 2006 at 07:03:13 Pacific OS: xp CPU/Ram: 512
Comment:
Hello
I am trying to export a datagrid to an excel file using VB.NET. I can do it in ASP.net like this: Dim oDS As DataSet = reports.GetDataset(StoredProcedure, oparams) Dim DG As New DataGrid DG.DataSource = oDS DG.DataBind() Dim stringWrite As New System.IO.StringWriter Dim htmlWrite As New System.Web.UI.HtmlTextWriter(stringWrite) DG.RenderControl(htmlWrite) reports.WriteFile(stringWrite.ToString, FileName)
(where reports contains all my functions)
but this method doesnt work in VB.NET as these two lines cannot be used in VB.NET: Dim htmlWrite As New System.Web.UI.HtmlTextWriter(stringWrite) DG.RenderControl(htmlWrite)
Does any one know of an alternative cos I'm stuck!
Summary: If e.g. i use vb.net codes to link to SQL server, is it possible to use Microsoft SQL server to update excel table? Then is it possible using html to get the excel table to vb.net application? Because...
Summary: I am using VB.NET to populate an excel spreadsheet and need to figure out how to add a blank row. My file has a header and a footer and I want the section where the data is contained to have only the...