# Quick Start

This quick start section helps you in getting started with the basic concepts of DsExcel library.

## Content

The following quick start section helps you in getting started with the DsExcel library:

#### .NET CORE CONSOLE APPLICATION

Follow the below steps to create a simple .NET Core Console application:

* [Step 1: Create a new Console App (.NET Core)](/document-solutions/dot-net-excel-api/docs/online/getting-started/quick-start#step-1-create-a-new-console-app-net-core)
* [Step 2: Create and save a new workbook](/document-solutions/dot-net-excel-api/docs/online/getting-started/quick-start#step-2-create-and-save-a-new-workbook)
* [Step 3: Build and Run the Project](/document-solutions/dot-net-excel-api/docs/online/getting-started/quick-start#step9)

#### Step 1: Create a new Console App (.NET Core)

1. In Visual Studio, select **File \| New \| Project** to create a new ASP.NET Core Console Application.
2. From the 'New Project' dialog, select **Installed \| Visual C\# \| \.NET Core \| Console App \(\.NET Core\)\,** and click **OK**.
3. Add the DsExcel .NET references to the project. In the **Solution Explorer**, right click **Dependencies** and select **Manage NuGet Packages**. In **NuGet Package Manager**, select **nuget.org** as the Package source. Search for ds.documents', select **DS.Documents.Excel**, and click **Install**.

#### Step 2: Create and save a new workbook

1. In Program.cs, include the following namespace
    using Grapecity.Documents.Excel;
2. Create a new workbook using the [Workbook](/document-solutions/dot-net-excel-api/api/online/DS.Documents.Excel/GrapeCity.Documents.Excel.Workbook.html) class, add a new worksheet to it and save the workbook using the [Save](/document-solutions/dot-net-excel-api/api/online/DS.Documents.Excel/GrapeCity.Documents.Excel.Workbook.Save.html) method of workbook class.

    ```csharp
    Workbook workbook = new Workbook(); 
    workbook.Worksheets[0].Range["A1"].Value = "Hello Word!"; 
    workbook.Save("HelloWord.xlsx");
    ```

#### Step 3: Build and Run the Project

1. Click **Build \| Build Solution** to build the project.
2. Press **F5** to run the project.
3. Once the project is executed, a console window is displayed and **HelloWord.xlsx** file is created at the specified location.

#### .NET CORE MVC APPLICATION

Follow the below steps to create a simple .NET Core MVC Application:

* [Step 1: Create a new Web Application (.NET Core)](/document-solutions/dot-net-excel-api/docs/online/getting-started/quick-start#step-1-create-a-new-web-application-net-core)
* [Step 2: Add a Controller](/document-solutions/dot-net-excel-api/docs/online/getting-started/quick-start#step-2-add-a-controller)
* [Step 3: Add a View](/document-solutions/dot-net-excel-api/docs/online/getting-started/quick-start#step-3-add-a-view)
* [Step 4: Build and Run the Project](/document-solutions/dot-net-excel-api/docs/online/getting-started/quick-start#step-4-build-and-run-the-project)

#### Step 1: Create a new Web Application (.NET Core)

1. In Visual Studio, select **File \| New \| Project** to create a new ASP.NET Core Web Application.
2. From the 'New Project' dialog, select **Installed \| Visual C\# \| \.NET Core \| ASP\.NET Core Web Application\,** and click **OK**.
3. In the 'New ASP.NET Core Web Application(.NET Core)' dialog, select **Web Application (Model-View-Controller)**, and click **OK**.
4. Add the DsExcel .NET references to the project. In the **Solution Explorer**, right click **Dependencies** and select **Manage NuGet Packages**. In **NuGet Package Manager**, select **nuget.org** as the Package source. Search for ds.documents', select **DS.Documents.Excel**, and click **Install**.

#### Step 2: Add a Controller

1. In the **Solution Explorer**, right click the folder **Controllers.**
2. From the context menu, select **Add \| Controller\.** The **Add Scaffold** dialog appears.
3. Complete the following steps in the **Add Scaffold** dialog:
    * Select **MVC Controller-Empty** and click **Add.**
    * Set name of the MVC controller (For example: DsExcelController) and click **Add.**
4. Add the DsExcel reference in Controller file:
    **using GrapeCity.Documents.Excel;**
5. In the Index() method of the Controller, add the following code:

    ```csharp
    public IActionResult Index()
            {
                Workbook workbook = new Workbook();
                workbook.Worksheets[0].Range["A1"].Value = "Hello Word!";                  
                workbook.Save("HelloWord.xlsx");
    
                return View();        
            }
    ```

A new Controller is added to the application within the folder **Controllers**.

#### Step 3: Add a View

1. From the **Solution Explorer**, right click the folder **Views** and select **Add \| New Folder**.
2. Name the new folder. Provide the same name as the name of your controller, minus the suffix Controller (in our example: DsExcel).
3. Right click the folder DsExcel, and select **Add \| View**. The **Add MVC View** dialog appears.
4. Complete the following steps in the **Add** **MVC View** dialog:
    * Set View name same as the Action name, Index (for example: Index.cshtml).
    * Click **Add**.
5. Replace the code in Index.cshtml file with below:

    ```html
    @{
    ViewData["Title"] = "Document Solutions for Excel, .NET Edition";
    }
    <script>
        onload = function () {
           alert("File Saved: HelloWord.xlsx");
    }
    </script>
    ```

#### Step 4: Build and Run the Project

1. Click **Build \| Build Solution** to build the project.
2. Press **F5** to run the project.
3. Once the project is executed, access the URL: `http://localhost:1234/DsExcel/Index` to generate the Excel file. An alert box is displayed and **HelloWord.xlsx** file is created at the specified location.