This repository contains samples demonstrating many features available in the following products:
Product features demonstrated include:
- Cell Formatting
- Range Operations
- Cell Formulas, Calculations and Values
- Worksheet features
- Workbook features
-
Charting Features
- Chart Types (Column, Line, Pie, Bar, Area, Stock, Scatter, Bubble, Radar, Gantt and Combination)
- Embedding Pictures in Charts
- Creating Chart Sheets
-
Shape Features
- Form Controls (Button, CheckBox, ComboBox, ListBox, Spinner, ScrollBar, GroupBox and OptionButton)
- Lines (with Weight, Dash Style and Arrowhead options)
- Pictures
- TextBoxes
- AutoShapes
- Printing Features
-
Image Rendering and WPF & WinForms Controls (Windows Only)
- Interactive WorkbookView and FormulaBar controls for Windows Forms and WPF
- High DPI image rendering of Ranges, Charts and other Shapes
- WorkbookDesigner dialog and "Explorer" dialogs to modify various aspects of a workbook such as worksheets, ranges, charts, shapes, etc.
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.)
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.
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.
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 aSpreadsheetGear.Drawing.Image
class that renders images of ranges, charts and other shapes. For more samples that demonstrate thisImage
class please see our website's Excel Chart and Range Imaging Razor Pages Samples.
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.
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.
The samples can be accessed and run in a variety of ways:
- GitHub Codespaces (
WebExplorer
samples project only) - Visual Studio 2022 (all samples projects)
- Visual Studio for Mac (
WebExplorer
samples project only) - Visual Studio Code (runnable projects depend on OS)
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.
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
samplesWpfExplorer
samplesWindowsFormsExplorer
samples
-
SpreadsheetGearExplorerSamples_Windows.sln (Requires the ".NET desktop development" workload)
WpfExplorer
samplesWindowsFormsExplorer
samples
-
SpreadsheetGearExplorerSamples_Web.sln - (Requires the "ASP.NET and web development" workload)
WebExplorer
samples
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 (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, LinuxWpfExplorer
samples - Windows OnlyWindowsFormsExplorer
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.
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
Additional samples can be found on the spreadsheetgear.com website: