Available for: UI for ASP.NET MVC | UI for ASP.NET AJAX | UI for Blazor | UI for WPF | UI for WinForms | UI for Silverlight | UI for Xamarin | UI for WinUI | UI for ASP.NET Core | UI for .NET MAUI

New to Telerik Document Processing? Download free 30-day trial

Getting Started

This article will get you started in using the RadSpreadProcessing library. It contains the following sections:

If you still don't have Telerik Document Processing installed, check the First Steps topic to learn how you can obtain the packages through the different suites.

Assembly References

The libraries support .NET 4 and later. .NET Standard-compatible binaries are available as well. The assemblies for .NET Standard don't include 'Windows' in their names. (e.g. Telerik.Documents.Core.dll). For more information check Cross-Platform Support article.

In order to use the model of the RadSpreadProcessing library in your project, you need to add references to the following assemblies:

.NET Framework .NET Standard-compatible Additional information
Telerik.Windows.Documents.Core.dll Telerik.Documents.Core.dll
Telerik.Windows.Documents.Spreadsheet.dll Telerik.Documents.Spreadsheet.dll
Telerik.Windows.Documents.Spreadsheet.FormatProviders.OpenXml.dll Telerik.Documents.Spreadsheet.FormatProviders.OpenXml.dll Required when importing/exporting from/to XLSX or CSV.
Telerik.Windows.Documents.Spreadsheet.FormatProviders.Xls.dll Telerik.Documents.Spreadsheet.FormatProviders.Xls.dll Required when importing/exporting from/to XLS.
Telerik.Windows.Documents.Spreadsheet.FormatProviders.Pdf.dll Telerik.Documents.Spreadsheet.FormatProviders.Pdf.dll Required when exporting to PDF.
Telerik.Windows.Documents.Fixed.dll Telerik.Documents.Fixed.dll Required when exporting to PDF.
Telerik.Windows.Zip.dll Telerik.Zip.dll Required for working with XLSX, XLS and PDF files.
- Telerik.Documents.ImageUtils.dll
This assembly is not available in UI for Xamarin.
*
 
To describe different colors, shapes and other properties, RadSpreadProcessing depends on the listed below .NET assemblies, which you should also refer in your project:
WindowsBase.dll -
PresentationCore.dll -
PresentationFramework.dll -

Needed when exporting to PDF format a document containing images different than Jpeg and Jpeg2000 or ImageQuality different than High. The Telerik.Documents.ImageUtils.dll assembly depends on SkiaSharp. In order to use this assembly, you will need to add а reference to SkiaSharp. With the R2 2023 changes SkiaSharp replaced ImageSharp as the required dependency.

Creating a Workbook

The document model allows you to instantiate a new workbook and populate it with any data you want.

Example 1 shows how you can create a workbook and add a new worksheet to it.

Example 1: Create Workbook

Workbook workbook = new Workbook(); 
Worksheet worksheet = workbook.Worksheets.Add(); 

You can then create a CellSelection and set any value to the selected cells. Example 2 shows how you can create a cell and set a string value to it.

Example 2: Set value of cell

CellSelection selection = worksheet.Cells[1, 1]; //B2 cell 
selection.SetValue("Hello RadSpreadProcessing"); 

Exporting

The RadSpreadProcessing library supports a variety of formats to which you can export the contents of a workbook using FormatProviders. Example 3 shows how you can export the previously created workbook to .xlsx format.

For more examples and application scenarios of Importing and Exporting a Workbook to various formats check out the Import/Load and Export/Save RadSpreadProcessing Workbook knowledge base article.

Example 3: Export to Xlsx

string fileName = "SampleFile.xlsx"; 
 
IWorkbookFormatProvider formatProvider = new XlsxFormatProvider(); 
 
using (Stream output = new FileStream(fileName, FileMode.Create)) 
{ 
    formatProvider.Export(workbook, output); 
} 

More information about the import and export functionalities of RadSpreadProcessing is available in the Formats and Conversion section.

Using RadSpreadsheet

RadSpreadsheet is a UI control part of the Telerik UI for WPF/Silverlight suites. The document model explained in this section of the documentation and all its features are shared between the RadSpreadProcessing library and RadSpreadsheet. This help section contains information about all UI-specific features of RadSpreadsheet.

See Also

In this article