aspose-cells / Aspose.Cells-for-.NET

Aspose.Cells for .NET examples, plugins and showcases
https://products.aspose.com/cells/net
MIT License
218 stars 103 forks source link

Nuget Nuget GitHub

.NET API for Excel Files

Aspose.Cells for .NET is an Excel Spreadsheet Programming API to speed up spreadsheet management and processing tasks. Excel .NET API supports to build cross-platform applications having the ability to generate, modify, convert, render and print spreadsheets.

Aspose.Cells for .NET also provides two GUI based .NET controls. Aspose.Cells.GridDesktop supports desktop applications and Aspose.Cells.GridWeb is specifically designed for .NET based web applications. Both Gird controls allow to import/export Excel files, manipulate data & formatting, customize grid design and layout, manage multiple worksheets, create and calculate Excel formulas and numerous other Excel-like operations.

Directory Description
Demos Source for the live demos hosted at https://products.aspose.app/cells/family.
Examples A collection of .NET examples that help you learn and explore the API features.
Examples of GridDesktop A collection of .NET examples that help you learn and use Aspose.Cells.GridDesktop.
Examples of GridWeb A collection of .NET examples that help you learn and use Aspose.Cells.GridWeb.
Plugins Visual Studio plugins of Aspose.Cells for .NET.

Spreadsheet Processing via .NET

Read & Write Spreadsheet Formats

Microsoft Excel: XLS, XLSX, XLSB, XLT, XLTX, XLTM, XLSM, XML\ OpenOffice: ODS\ Text: CSV, TSV\ Web: HTML, MHTML\ Numbers: Apple's iWork office suite Numbers app documents

Save Excel Files As

Fixed Layout: PDF, PDF/A, XPS\ Data Interchange: DIF\ Images: JPEG, PNG, BMP, SVG, TIFF, EMF, GIF

Platform Independence

Aspose.Cells for .NET can be used to build ASP.NET, Web Services, WinForms or other .NET applications for framework 2.0 or later on 32-bit and 64-bit operating systems. It also provides dedicated assemblies for Xamarin.Android (for native Android apps), Xamarin.iOS (for native iOS apps), COM (for pre-.NET technologies), Mono, and Windows Azure.

Get Started with Aspose.Cells for .NET

Are you ready to give Aspose.Cells for .NET a try? Simply execute Install-Package Aspose.Cells from Package Manager Console in Visual Studio to fetch the NuGet package. If you already have Aspose.Cells for .NET and want to upgrade the version, please execute Update-Package Aspose.Cells to get the latest version.

Create XLSX Excel File from Scratch

// initiate an instance of Workbook
var book = new Aspose.Cells.Workbook();
// access first (default) worksheet
var sheet = book.Worksheets[0];
// access CellsCollection of first worksheet
var cells = sheet.Cells;
// write HelloWorld to cells A1
cells["A1"].Value = "Hello World";
// save spreadsheet to disc
book.Save("output.xlsx", SaveFormat.Xlsx);

Convert Excel Files to PDF, XPS & HTML

Aspose.Cells for .NET is capable of converting spreadsheets to numerous other popular formats including PDF, XPS & HTML formats while maintaining the highest visual fidelity. The conversion process is simple, configurable and reliable.

// load file to be converted
var workbook = new Aspose.Cells.Workbook(dir + "template.xlsx");
// save in different formats
workbook.Save(dir + "output.pdf", Aspose.Cells.SaveFormat.Pdf);
workbook.Save(dir + "output.xps", Aspose.Cells.SaveFormat.XPS);
workbook.Save(dir + "output.html", Aspose.Cells.SaveFormat.Html);

Encrypt Excel Spreadsheet

var workbook = new Aspose.Cells.Workbook(dir+ "template.xls");

// specify XOR encryption type
workbook.SetEncryptionOptions(EncryptionType.XOR, 40);

// specify strong encryption type (RC4,Microsoft Strong Cryptographic Provider)
workbook.SetEncryptionOptions(EncryptionType.StrongCryptographicProvider, 128);

// protect the file
workbook.Settings.Password = "1234";

// save the file
workbook.Save(dir+ "output.xls");

Create an Excel Line Chart

var workbook = new Aspose.Cells.Workbook();

// add a new worksheet to the Excel object
int sheetIndex = workbook.Worksheets.Add();

// obtain the reference of the newly added worksheet by passing its sheet index
Worksheet worksheet = workbook.Worksheets[sheetIndex];

// add sample values to cells
worksheet.Cells["A1"].PutValue(50);
worksheet.Cells["A2"].PutValue(100);
worksheet.Cells["A3"].PutValue(150);
worksheet.Cells["B1"].PutValue(4);
worksheet.Cells["B2"].PutValue(20);
worksheet.Cells["B3"].PutValue(50);

// add a chart to the worksheet
int chartIndex = worksheet.Charts.Add(Aspose.Cells.Charts.ChartType.Line, 5, 0, 15, 5);

// access the instance of the newly added chart
var chart = worksheet.Charts[chartIndex];

// add chart data source from "A1" to "B3"
chart.NSeries.Add("A1:B3", true);

// save the Excel file
workbook.Save( dir + "output.xls");

Home | Product Page | Docs | Demos | API Reference | Examples | Blog | Search | Free Support | Temporary License