Saving an Excel File

Introduction

To save the content of Aspose.Cells.GridDesktop control as an Excel file, Aspose.Cells.GridDesktop provides follwoing methods.

  1. Saving as a File
  2. Saving as a Stream

Saving File

Create a desktop application and add two buttons with a GridControl control to the form. Set text properties of buttons as Save as File and Save as Stream respectively.

Saving as a File

Create the Click event of the Save as File button and paste the following code inside it.

Saving as a Stream

Sometimes, it might be required by developers to save their Grid contents to a stream (For example, MemoryStream). To facilitate this task, Aspose.Cells.GridDesktop control also supports saving Grid data to a stream. Create the Click event of the Save as Stream button and paste the following code inside it.