New to Telerik Document ProcessingStart a free 30-day trial

Getting Started

Updated on Jun 16, 2026

RadSpreadStreamProcessing enables you to create and read spreadsheet documents with high performance and minimal memory consumption.

If you still do not have Telerik Document Processing installed, check the First Steps topic to learn how you can get the packages through the different suites.

Package References

You can find the required references in the SpreadStreamProcessing NuGet packages section.

Create a Spreadsheet Document

This section explains how to create a document. If you need more detailed information about the classes that export the different document elements, check the articles from the Model section.

When you create a document with RadSpreadStreamProcessing, the order in which the elements are created is very important. To minimize resource consumption, the library writes the content directly to a stream, and due to the structure of the file format, you must create the elements in the following order:

  1. Create a Workbook

  2. Create a Worksheet

  3. Create Columns (optional)

  4. Create Rows (a worksheet must contain at least one row)

  5. Create Cells (optional)

  6. Merge Cells (optional)

Example 1 shows how to create a simple document.

Example 1: Create a Document

C#
using (FileStream stream = File.OpenWrite("sample.xlsx"))
{
	using (IWorkbookExporter workbook = SpreadExporter.CreateWorkbookExporter(SpreadDocumentFormat.Xlsx, stream))
	{
		using (IWorksheetExporter worksheet = workbook.CreateWorksheetExporter("My sheet"))
		{
			worksheet.SkipColumns(1);
			using (IColumnExporter column = worksheet.CreateColumnExporter())
			{
				column.SetWidthInPixels(80);
			}

			worksheet.SkipRows(3);
			using (IRowExporter row = worksheet.CreateRowExporter())
			{
				row.SkipCells(3);
				using (ICellExporter cell = row.CreateCellExporter())
				{
					cell.SetValue("Merged cell.");
					cell.SetFormat(new SpreadCellFormat()
					{
						HorizontalAlignment = SpreadHorizontalAlignment.Center,
						VerticalAlignment = SpreadVerticalAlignment.Center
					});
				}
			}

			using (IRowExporter row = worksheet.CreateRowExporter())
			{
				row.SetHeightInPixels(200);
				using (ICellExporter cell = row.CreateCellExporter())
				{
					cell.SetValue(123.456);
				}

				using (ICellExporter cell = row.CreateCellExporter())
				{
					SpreadCellFormat format = new SpreadCellFormat()
					{
						NumberFormat = "dd/mm/yyyy",
						IsBold = true
					};
					cell.SetFormat(format);
					cell.SetValue(42370);
				}
			}

			worksheet.MergeCells(3, 3, 6, 6);
		}
	}
}

Figure 1 shows the result of executing the code from Example 1.

Figure 1: The document created in Example 1

The spreadsheet document created in Example 1

Read Existing Document

When you read a document with RadSpreadStreamProcessing, the order of parsing the content is very important. To minimize resource consumption, the library parses only the parts required by the user and, due to the file structure, you must read the desired elements in the following order:

  1. Read the Workbook

  2. Read a Worksheet

  3. Read Columns (optional)

  4. Read Rows (a worksheet must contain at least one row)

  5. Read Cells (optional)

Example 2 demonstrates how to read the data from an existing document.

Example 2: Read Data from a Document

C#
using (FileStream fs = new FileStream(fileName, FileMode.Open))
			{
				using (IWorkbookImporter workBookImporter = SpreadImporter.CreateWorkbookImporter(SpreadDocumentFormat.Xlsx, fs))
				{
					foreach (IWorksheetImporter worksheetImporter in workBookImporter.WorksheetImporters)
					{
						foreach (IRowImporter rowImporter in worksheetImporter.Rows)
						{
							foreach (ICellImporter cell in rowImporter.Cells)
							{
								string value = cell.Value;
							}
						}
					}
				}
			}

For more complete examples, go to the Developer Focused Examples section of the library.

See Also