Get started with Documents for Excel in Windows, Mac, and Linux
This guide explains how to create a program that uses DsExcel, previously GcExcel, to generate and save to disk an Excel file.
Document Solutions for Excel assemblies are built for .NET Standard 2.0, and can be used with any target that supports it. In this short tutorial, we show how to add reference to GcExcel in .NET Core application. The tutorial also takes you through the steps required to do that in Visual Studio on Windows or MAC, or Visual Studio Code on Linux.
These videos cover installing Documents for Excel on Windows, Mac, and Linux and how to create basic Excel spreadsheet using DsExcel.
Get started with Documents for Excel on Windows
Get started with Documents for Excel on Mac
Get started with Documents for Excel on Linux
Step 1: Create an app in the IDE of your choice
Create an app using Visual Studio on Windows
1. Open Visual Studio for Windows.
2. Create a new .NET Core Console Application.
3. Right click the project in Solution Explorer and choose Manage NuGet Packages.
4. In Package source in top right, select nuget.org.
5. Click Browse tab in top left and enter "GrapeCity.Documents.Excel" as the search string. You should see several GrapeCity.Documents packages listed.
6. Select GrapeCity.Documents.Excel, and click Install. Accept the license agreement.
This will add the required references to your application. You can now jump to Add code to your application topic from where you can start learning how to use DsExcel features in detail.
Create an app using Visual Studio on MAC
1. Open Visual Studio for MAC.
2. Create a new .NET Core Console Application.
3. In the tree view on the left, right click Dependencies and choose Add Packages.
4. In the Search panel, type "GrapeCity.Documents.Excel".
5. From the list in the left panel, select GrapeCity.Documents.Excel and click Add Packages.
6. Accept the license agreement.
This will add the required references to your application. You can now jump to Add code to your application topic from where you can start learning how to use DsExcel features in detail.
Create an app using Visual Studio Code on Linux
1. In a terminal window (you may use the Terminal in Visual Studio Code), type the following commands:
2. Open Visual Studio Code.
3. If you haven't already done so, from Extensions install Nuget Package Manager, and activate it.
4. In Visual Studio Code, press Ctrl+P to open the file command box, type > in it, find "Nuget Package Manager: Add Package" in the list that opens, and click it.
5. In the search box that opens, type "GrapeCity.Documents.Excel" and press Enter. This should bring up GrapeCity.Documents.Excel package.
6. Select it. This will add a reference to that package to you .csproj file, which would now look like this:
7. In a terminal window, type the following commands to build and run the app:
You can now jump to Add code to your application topic from where you can start learning how to use GcExcel features in detail.
Step 2: Add code to your application
Open Program.cs in Visual Studio or Visual Studio Code, and modify it so that it looks like this:
Step 3: Run the application
-
On Windows or MAC, just click the "start debugging" button in Visual Studio.
-
On Linux, enter the following in a terminal window:
That's all it takes to generate an Excel Spreadsheet file using DsExcel. The 'SimpleBudget.xlsx' should now be in your project directory. If you'd like to generate an Excel file with more content and with multiple sheets, you can read How to generate Excel spreadsheets in code with Documents for Excel.