![]() |
![]() |
||
The time now is 9:33pm You last visited Today at 9:27pm |
|
||
![]() |
|
| How to Create an Excel File in an ASP Net Web Site | |
|
| |
|
| Author | Message |
joeluice
Newbie
Joined: 29 Mar 2010 Online Status: Offline Posts: 4 |
Topic: How to Create an Excel File in an ASP Net Web SitePosted: 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 Logged |
|
![]() |
|
mikesleves
Newbie
Joined: 29 Mar 2010 Online Status: Offline Posts: 3 |
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 Logged |
|
![]() |
|
peterjoy
Newbie
Joined: 09 Aug 2010 Location: United States Online Status: Offline Posts: 5 |
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 Logged |
|
![]() |
|
steve111
Newbie
Joined: Today Location: Bahrain Online Status: Offline Posts: 1 |
Posted: Today at 6:37am |
|
try the Grid View..
it will provide better performance then the spreadsheet !! |
|
IP Logged |
|
![]() |
|
|
|
| Forum Jump | Forum Permissions ![]() You cannot post new topics in this forum You cannot reply to topics in this forum You cannot delete your posts in this forum You cannot edit your posts in this forum You cannot create polls in this forum You cannot vote in polls in this forum |