Wrox Programmer Forums

Need to download code?

View our list of code downloads.

Go Back   Wrox Programmer Forums > ASP.NET and ASP > ASP.NET 1.0 and 1.1 > ASP.NET 1.0 and 1.1 Professional
Password Reminder
Register
Register | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read
ASP.NET 1.0 and 1.1 Professional For advanced ASP.NET 1.x coders. Beginning-level questions will be redirected to other forums. NOT for "classic" ASP 3 or the newer ASP.NET 2.0 and 3.5
Welcome to the p2p.wrox.com Forums.

You are currently viewing the ASP.NET 1.0 and 1.1 Professional section of the Wrox Programmer to Programmer discussions. This is a community of tens of thousands of software programmers and website developers including Wrox book authors and readers. As a guest, you can read any forum posting. By joining today you can post your own programming questions, respond to other developersí questions, and eliminate the ads that are displayed to guests. Registration is fast, simple and absolutely free .
DRM-free e-books 300x50
 
 
Thread Tools Display Modes
  #1 (permalink)  
Old July 28th, 2004, 06:21 AM
Authorized User
 
Join Date: Jan 2004
Location: , , .
Posts: 60
Thanks: 0
Thanked 0 Times in 0 Posts
Default Generate Excel spreadsheet with ASP.Net (VB)

Hi there,

I understand there are commercial ASP.Net tools available that enable you to generate an Excel spreadsheet on the server (from a set of data) and send it to the user's browser (for opening there).

I have looked at a couple of these.

Please can someone recommend one to me? The best one... or a good one...

Many thanks.

James
  #2 (permalink)  
Old July 28th, 2004, 08:47 AM
planoie's Avatar
Friend of Wrox
Points: 16,481, Level: 55
Points: 16,481, Level: 55 Points: 16,481, Level: 55 Points: 16,481, Level: 55
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Aug 2003
Location: Clifton Park, New York, USA.
Posts: 5,413
Thanks: 0
Thanked 16 Times in 16 Posts
Default

You don't need anything commercial. You can generate Excel with raw HTML. All you need to do is generate an HTML <table> with your data and formatting within it. You also need to specify the content type of the response so the browser knows that it's looking at "Excel content". There are numerous example on this forum that explain how to do this. Try searching on here for "excel" and "ContentType". That should get you pretty close to what you need.
  #3 (permalink)  
Old December 11th, 2013, 08:15 AM
Registered User
Points: 21, Level: 1
Points: 21, Level: 1 Points: 21, Level: 1 Points: 21, Level: 1
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Dec 2013
Posts: 7
Thanks: 0
Thanked 0 Times in 0 Posts
Default Re: Generate Excel spreadsheet with ASP.Net (VB)

Hi, to create an Excel file in .NET you can check out a free version of this VB.NET Excel component.
Here is a small demonstration how to export an Excel file in ASP.NET:
Code:
' Extract DataTable from current ASP.NET session.
Dim dataTable = DirectCast(Me.Session("people"), DataTable)

' Create Excel file.
Dim workbook = New ExcelFile()
Dim worksheet = workbook.Worksheets.Add("DataSheet")

' Insert DataTable to worksheet.
worksheet.InsertDataTable(dataTable,
    New InsertDataTableOptions("A1") With {.ColumnHeaders = True})

' Stream file to browser in XLS file format.
workbook.Save(Me.Response, "Sample.xls")
 


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
connecting to excel spreadsheet using asp codetoad Classic ASP Databases 1 March 21st, 2007 05:02 AM
Launch the .Net Win Forms from Excel spreadsheet Arunikhanna81 C# 0 January 15th, 2007 10:54 PM
Embedding an Excel spreadsheet in a VB application James Diamond Pro VB.NET 2002/2003 3 April 21st, 2004 12:18 PM



All times are GMT -4. The time now is 09:11 AM.


Powered by vBulletin®
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.
© 2013 John Wiley & Sons, Inc.