/SpreadsheetGearExplorerSamples

SpreadsheetGear samples for the Web, WPF and Windows Forms.

Primary LanguageC#

SpreadsheetGear Logo SpreadsheetGear Explorer Samples

This repository contains samples demonstrating many features available in the following products:

Product features demonstrated include:

SpreadsheetGear Products and Supported Platforms

Logo for 'SpreadsheetGear Engine for .NET' product SpreadsheetGear Engine for .NET

SpreadsheetGear Engine for .NET provides a core set of APIs to read, write, manipulate and calculate workbooks, build charts, format worksheets and cells, and more.

This product targets both .NET 6 (net6.0) and .NET Standard 2.0 (netstandard2.0), providing a wide array of supported platforms and OS including:

  • .NET Core 2.0 - .NET 6+
  • .NET Framework 4.6.2+
  • Windows
  • MacOS
  • Linux
  • Mono
  • Xamarin (iOS, Android, etc.)

Logo for Windows 11 SpreadsheetGear for Windows

Builds on the capabilities of SpreadsheetGear Engine for .NET to add powerful Excel-compatible image rendering, viewing, editing, formatting, calculating, filtering, sorting, charting, printing and more to your Windows Forms and WPF applications with the easy-to-use WorkbookView and FormulaBar controls.

Note

SpreadsheetGear for Windows targets .NET 6 for Windows (net6.0-windows).

Note

SpreadsheetGear for Windows includes a license to also use SpreadsheetGear Engine for .NET.

Learn more about these products on our Features Page and more details on their differences on our Comparison Page.

Sample Projects

There are 3 executable Visual Studio Projects (*.csproj) in this repository, pictured and described in more detail below. These projects work with Visual Studio 2022, Visual Studio Code (VSCode) and Visual Studio for Mac. See the Running the Samples section for more details on running these projects in your preferred IDE.

Web Explorer Samples

Screenshot of the WPF Explorer

The Web Explorer presents SpreadsheetGear Engine for .NET samples using an ASP.NET Core Web App. Note this VS Project targets both net6.0 and net6.0-windows:

  • net6.0: Use this target framework to run the samples on a wide variety of platforms such as Windows, MacOS and Linux. Most samples provide an option to download an Excel workbook file with the results of the sample.
  • net6.0-windows: Use this target framework when running on Windows to provide an additional option to render an image of many of sample results. Image rendering is accomplished by utilizing the SpreadsheetGear for Windows product, which has a SpreadsheetGear.Drawing.Image class that renders images of ranges, charts and other shapes. For more samples that demonstrate this Image class please see our website's Excel Chart and Range Imaging Razor Pages Samples.

WPF Explorer Samples

Screenshot of the WPF Explorer

The WPF Explorer presents samples applicable to both the SpreadsheetGear Engine for .NET and SpreadsheetGear for Windows products in the context of a WPF Desktop App, where the WPF WorkbookView and FormulaBar controls are utilized to provide an interactive Excel-like experience when presenting the results of a given sample.

Note

These samples target net6.0-windows and so require running on Windows with the SpreadsheetGear for Windows product.

Windows Forms Explorer Samples

Screenshot of the WPF Explorer The Windows Forms Explorer presents samples applicable to both the SpreadsheetGear Engine for .NET and SpreadsheetGear for Windows products in the context of a Windows Forms Desktop App, where the Windows Forms WorkbookView and FormulaBar controls are utilized to provide an interactive Excel-like experience when presenting the results of a given sample.

Note

These samples target net6.0-windows and so require running on Windows with the SpreadsheetGear for Windows product.

Running the Samples

The samples can be accessed and run in a variety of ways:

GitHub Codespaces

The WebExplorer samples can be run right here in the browser using GitHub Codespaces. Ensure you are logged into your GitHub account and click on the "Code" dropdown button at the top of this page to launch a new codespace and start the samples. More details can be found here.

Visual Studio 2022

Three Visual Studio Solutions (*.sln) are provided in the repository root folder to use with Visual Studio 2022. Below is a list of the "Explorer" Visual Studio Projects that are included in each of the Solutions:

  • SpreadsheetGearExplorerSamples.sln (Requires the "ASP.NET and web development" and ".NET desktop development" workloads)

    • WebExplorer samples
    • WpfExplorer samples
    • WindowsFormsExplorer samples
  • SpreadsheetGearExplorerSamples_Windows.sln (Requires the ".NET desktop development" workload)

    • WpfExplorer samples
    • WindowsFormsExplorer samples
  • SpreadsheetGearExplorerSamples_Web.sln - (Requires the "ASP.NET and web development" workload)

    • WebExplorer samples

Visual Studio for Mac

Please use the SpreadsheetGearExplorerSamples_Web.sln in the repository root folder to access the WebExplorer Samples. The other 2 Solutions include Windows-only VS Projects that utilize the SpreadsheetGear for Windows product, which is not supported on a Mac.

Visual Studio Code

Visual Studio Code (VSCode) is a cross-platform code editor, supported on Windows, MacOS and Linux; however, keep in mind that some of the SpreadsheetGear Explorer Samples run only on Windows:

  • WebExplorer samples - Windows, MacOS, Linux
  • WpfExplorer samples - Windows Only
  • WindowsFormsExplorer samples - Windows Only

To run applicable samples with Visual Studio Code, please also install the .NET 6.0 SDK and the Microsoft C# Dev Kit Extension for Visual Studio Code. After cloning the repo, open the root SpreadsheetGearExplorerSamples folder in VSCode and build & launch any of the above Explorer sample projects from the Run and Debug Side Bar.

Visual Studio Code's Run and Debug Side Bar

Note

If you are on MacOS or Linux, the WPF and Windows Forms Explorer samples will not be runnable. The "Web Explorer" samples are runnable from MacOS and Linux, although image rendering (used to show results of many of the samples) is only available on Windows when running the net6.0-windows target of this project.

The below individual folders can also be opened in VSCode, and relevant options will be provided to build & run the samples:

  • SpreadsheetGearExplorerSamples/WebExplorer
  • SpreadsheetGearExplorerSamples/WPFExplorer
  • SpreadsheetGearExplorerSamples/WindowsFormsExplorer

These folders also contain *.code-workspace files that you can open in VSCode (instead of opening the folder) if you would like to have all dependent projects included when viewing VSCode's Explorer Side Bar

Other Samples

Additional samples can be found on the spreadsheetgear.com website: