Username: Password:
The time now is 9:33pm
You last visited Today at 9:27pm
    Register
Home Search the forumFAQs View active topics View active users View Members View group
How to Create an Excel File in an ASP Net Web Site
 WebExcel Forums > The Technologies > ASP.NET Technical Discussions  
Message Icon Topic: How to Create an Excel File in an ASP Net Web Site Post Reply New Topic
 
Author Message
joeluice View Drop Down
Newbie
Newbie
Avatar

Joined: 29 Mar 2010
Online Status: Offline
Posts: 4
Quote joeluice Reply bullet Topic: How to Create an Excel File in an ASP Net Web Site
    Posted: 29 Mar 2010 at 7:08am
ASP Web pages provide dynamically created content for website users. You can use the ASP C# language to dynamically create spreadsheets and open the Excel software to view the files. Excel spreadsheets are used to create lists or keep track of data such as finances, sales and marketing. The ASP C# language provides you with internal functions and classes that make it simple to generate Excel reports on your website.
IP IP Logged
Back to Top
mikesleves View Drop Down
Newbie
Newbie


Joined: 29 Mar 2010
Online Status: Offline
Posts: 3
Quote mikesleves Reply bullet Posted: 29 Mar 2010 at 12:52pm
To Create an Excel File in an ASP Net Web Site Go from this steps First of all you have to nvoke the "Stringwriter" and "HtmlTextwriter" classes. The following code creates variables for these classes:
Dim sw As New System.IO.StringWriter()
Dim tw As New System.Web.UI.HtmlTextWriter(sw)
Then Step 2 is:
Write some text to the textwriter variable. This text is displayed in the Excel file. In this example, a header is printed to the first Excel cell. The code below writes to the textwriter variable:
tw.WriteLine("<b> My Excel File </b>")

Then move to Step 3:
Place the header for the output. The response header tells the browser what type of file is displayed on the Web page, and the program used to open it. The following code directs the user's browser to open the file with Excel:
Response.ContentType = "application/vnd.ms-excel"

Then Step 4:
Display the Excel file to the user. The following code opens the Excel spreadsheet in the browser:
Response.Write(tw.ToString())
The user can view the page only or click the "Save" button to save the file to the hard drive.

Your Excel File have been created....
IP IP Logged
Back to Top
peterjoy View Drop Down
Newbie
Newbie


Joined: 09 Aug 2010
Location: United States
Online Status: Offline
Posts: 5
Quote peterjoy Reply bullet Posted: 09 Aug 2010 at 8:38am
Excel spreadsheets used to create lists or keeping track of data such as finance, sales and marketing. ASP C# language provides the internal functions and classes that make it easy to generate Excel reports on your site.
IP IP Logged
Back to Top
steve111 View Drop Down
Newbie
Newbie


Joined: Today
Location: Bahrain
Online Status: Offline
Posts: 1
Quote steve111 Reply bullet Posted: Today at 6:37am
try the Grid View..

it will provide better performance then the spreadsheet !!
IP IP Logged
Back to Top

Printable Version Printable Version
Forum Jump Forum Permissions View Drop Down



This page was generated in 0.047 seconds.