Home
We need your feedback!

Bytescout Spreadsheet SDK for .NET
Screenshots

Click to view sample
Click to view sample
Click to view sample
Click to view sample
Click to view sample
Click to view sample
Click to view sample Click to view sample
Subscribe to Our Bi-Monthly Newsletter (tips, new releases, specials):
 Subscribe in a reader
 PRODUCTS  |  DOWNLOAD  |  PURCHASE  |  SUPPORT  |  TESTIMONIALS   |  NEWS  | 

Bytescout Spreadsheet SDK for .NET

Download Free Trial Buy Now More Information
Shop Safely: Bytescout Spreadsheet SDK comes with a 30-DAY UNCONDITIONAL MONEY-BACK GUARANTEE

Generating XLS documents from ASP.NET code using Bytescout Spreadsheet for .NET

This sample source code is designed to show how to generate Excel (XLS) document from ASP.NET using Bytescout Spreadsheet SDK and then write produced document into browser using Response object (implementing on-the-fly output)

Download example source code: bytescoutxls_asp_net.zip (2 KB)

Excel (XLS) document generated from ASP.NET application using Bytescout Spreadsheet

To run Bytescout Spreadsheet on a ASP.NET project just do the following:

1) Run Visual Studio 2005
2) Create new "Web-Site" project using Project Wizard
3) Click "Website" menu and then "Add Reference" command in this menu
4) "Add Reference" dialog will appear. Select "Bytescout Spreadsheet" and click OK to add a reference to Bytescout Spreadsheet component
5) Double-click "Default.aspx.cs" in Solution Explorer and then copy and paste the following code into it:

using System;
using System.Data;
using System.Configuration;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;
using Bytescout.Spreadsheet;

public partial class _Default : System.Web.UI.Page
{
protected void Page_Load(object sender, EventArgs e)
{
// Create new document
Spreadsheet document = new Spreadsheet();

// Add "HelloWorld" worksheet
Worksheet worksheet = document.Workbook.Worksheets.Add("HelloWorld");

// Set cell B2 value "HelloWorld"
worksheet.Cell(0, 0).Value = "HelloWorld";

// clear http output
Response.Clear();
// set the content type to XLS
Response.ContentType = "application/xls";
// add content type header
Response.AddHeader("Content-Type", "application/xls");
// set the content disposition
Response.AddHeader("Content-Disposition", "inline;filename=HelloWorld.xls");
// write the buffer with pdf file to the output
document.SaveToStream(Response.OutputStream);

Response.End();
}
}

Then run ASP.NET web-site using F5 button

Download example source code: bytescoutxls_asp_net.zip (2 KB)

Download Free Trial Buy Now More Information
Shop Safely: Bytescout Spreadsheet SDK comes with a 30-DAY UNCONDITIONAL MONEY-BACK GUARANTEE

Documentation online: view (separate window)

First steps tutorials:

Advanced Examples:

HOME  |  CONTACT US

Copyright © ByteScout, 2003-2010. Privacy Statement
Microsoft®, Windows®, Windows 2000®, Windows Server®, Windows Vista®, Internet Explorer®, .NET Framework®, ActiveX®, Visual Basic®, Visual C#®, ASP®, ASP.NET®, Excel®, PowerPoint®, are either registered trademarks or trademarks of Microsoft Corporation in the United States and/or other countries. Adobe®, Flash® and Acrobat® are registered trademarks of Adobe Systems, Incorporated. Mozilla®, Firefox® and the Mozilla and Firefox Logos are registered trademarks of the Mozilla Foundation. Other product names or brandnames used herein are for identification purposes only and might be trademarks or registered trademarks of their respective companies. We disclaim any and all rights to those marks.