Data set excel file

To create a data set using a Microsoft Excel file stored locally:

  1. Click the New Data Set toolbar button and select Microsoft Excel File.
  2. Enter a name for this data set.
  3. Select Local to enable the upload button.
  4. Click the Upload icon to browse for and upload the Microsoft Excel file from a local directory.

Contents

  • 1 How do you create a dataset?
  • 2 What is the dataset in Excel?
  • 3 Can we create our own dataset?
  • 4 Can I create my own dataset for machine learning?
  • 5 How do I create an autofill form in Excel?
  • 6 How do I create a data model in Excel?
  • 7 What is a data set example?
  • 8 How do you create a deep learning dataset?
  • 9 How do you create a dataset of an image?
  • 10 How do you prepare a dataset for analysis?
  • 11 What is the process of creating and using a dataset?
  • 12 How do you create a training dataset for machine learning?
  • 13 What makes a good dataset?
  • 14 How do I AutoFill an entire column in Excel?
  • 15 How do I align two data sets in Excel?
  • 16 How do you add data to a table?
  • 17 What does a dataset look like?
  • 18 What are dataset entries?
  • 19 What are the types of data sets?
  • 20 What is dataset in deep learning?

On the Create dataset page:

  1. For Dataset ID, enter a unique dataset name.
  2. For Data location, choose a geographic location for the dataset. After a dataset is created, the location can’t be changed.
  3. For Default table expiration, choose one of the following options:
  4. Click Create dataset.

What is the dataset in Excel?

A dataset is a range of contiguous cells on an Excel worksheet containing data to analyze. When arranging data on an Excel worksheet you must follow a few simple rules so that Analyse-it works with your data: Title to clearly describe the data.

Can we create our own dataset?

While you can get robust datasets from Kaggle, if you want to creating something fresh for you or your company, scraping is the way to go, for example. if you want to build a price recommendation for shoes you would want the latest trends and prices from Amazon and not 2 years old data.

Can I create my own dataset for machine learning?

Dataset preparation is sometimes a DIY project
If you were to consider a spherical machine-learning cow, all data preparation should be done by a dedicated data scientist.So, let’s have a look at the most common dataset problems and the ways to solve them.

How do I create an autofill form in Excel?

Fill data automatically in worksheet cells

  1. Select one or more cells you want to use as a basis for filling additional cells. For a series like 1, 2, 3, 4, 5…, type 1 and 2 in the first two cells.
  2. Drag the fill handle .
  3. If needed, click Auto Fill Options. and choose the option you want.

How do I create a data model in Excel?

It can be any range of data, but data formatted as an Excel table is best. Use one of these approaches to add your data: Click Power Pivot > Add to Data Model. Click Insert > PivotTable, and then check Add this data to the Data Model in the Create PivotTable dialog box.

What is a data set example?

A data set is a collection of numbers or values that relate to a particular subject. For example, the test scores of each student in a particular class is a data set. The number of fish eaten by each dolphin at an aquarium is a data set.

How do you create a deep learning dataset?

Steps for Preparing Good Training Datasets

  1. Identify Your Goal. The initial step is to pinpoint the set of objectives that you want to achieve through a machine learning application.
  2. Select Suitable Algorithms. different algorithms are suitable for training artificial neural networks.
  3. Develop Your Dataset.

How do you create a dataset of an image?

Procedure

  1. From the cluster management console, select Workload > Spark > Deep Learning.
  2. Select the Datasets tab.
  3. Click New.
  4. Create a dataset from Images for Object Classification.
  5. Provide a dataset name.
  6. Specify a Spark instance group.
  7. Specify image storage format, either LMDB for Caffe or TFRecords for TensorFlow.

How do you prepare a dataset for analysis?

Data Preparation Steps in Detail

  1. Access the data.
  2. Ingest (or fetch) the data.
  3. Cleanse the data.
  4. Format the data.
  5. Combine the data.
  6. And finally, analyze the data.

What is the process of creating and using a dataset?

The process of creating a dataset involves three important steps:

  1. Data Acquisition.
  2. Data Cleaning.
  3. Data Labeling.

How do you create a training dataset for machine learning?

How to create a machine learning dataset from scratch?

  1. Detect individual letters in an image.
  2. Create a training dataset from these letters.
  3. Train an algorithm to classify the letters.
  4. Use the trained algorithm to classify individual letters (online)

What makes a good dataset?

A “good dataset” is a dataset that : Does not contains missing values. Does not contains aberrant data. Is easy to manipulate (logical structure).

How do I AutoFill an entire column in Excel?

Simply do the following:

  1. Select the cell with the formula and the adjacent cells you want to fill.
  2. Click Home > Fill, and choose either Down, Right, Up, or Left. Keyboard shortcut: You can also press Ctrl+D to fill the formula down in a column, or Ctrl+R to fill the formula to the right in a row.

How do I align two data sets in Excel?

Now you can create a new sheet and click on cell A1 in the new sheet. Now go to Data > Consolidate. In the popup select the range from your first sheet to the reference box and click on Add, after adding the first data select the reference box again and clear the reference box and add the second data set.

How do you add data to a table?

Add a row or column to a table by typing in a cell just below the last row or to the right of the last column, by pasting data into a cell, or by inserting rows or columns between existing rows or columns. To add a row at the bottom of the table, start typing in a cell below the last table row.

What does a dataset look like?

A dataset (example set) is a collection of data with a defined structure. Table 2.1 shows a dataset. It has a well-defined structure with 10 rows and 3 columns along with the column headers. This structure is also sometimes referred to as a “data frame”.

What are dataset entries?

ENTRY: Uses the Numeric data type and stores a value representing the order in which the entries are logged. The example includes seven separate entries by four people, and every entry has a unique number. ID: Uses the Numeric data type and stores an identifying number for the person associated with each entry.

What are the types of data sets?

Types of Data Sets

  • Numerical data sets.
  • Bivariate data sets.
  • Multivariate data sets.
  • Categorical data sets.
  • Correlation data sets.

What is dataset in deep learning?

A data set is a collection of data.In Machine Learning projects, we need a training data set. It is the actual data set used to train the model for performing various actions.

Spreadsheet Sample Data in Excel & CSV Formats

I have put this page together to provide everyone with data that you would come across in the REAL WORLD. Whether you are looking for some Pivot Table practice data or data that you can flow through an Excel dashboard you are building, this article will hopefully provide you with a good starting point.

All the example data is free for you to use any way you’d like. I have saved the data in both an Excel format (.xlsx) and a comma-separated values format (.csv).

What Can This Data Be Useful For?

  • Feeding Dashboards

  • Manipulating in Power Query

  • Feeding into Power BI

  • Practicing Excel Formulas (VLOOKUP Practice Data)

  • Testing Spreadsheet Solutions

  • Example Data for Articles or Videos You Are Making

Which Spreadsheet/BI Programs Can I Use This Data With?

  • Power BI

  • Tableau

  • LibreOffice (OpenOffice)

  • Tell me in the comments if there are others!

  • Microsoft Excel

  • Google Sheets

  • Apple Numbers

  • Excel’s Power Query

Company Employee Example Data

Folks in Human Resources actually deal with a lot of data. This data can be great for creating dashboards and summarizing various aspects of a company’s workforce. In this database, there are 1,000 rows of data encompassing popular data points that HR professionals deal with on a regular basis.

You can use this data to practice popular spreadsheet features including Pivot Table, Vlookups, Xlookups, Power Query automation, charts, and Dashboards.

Columns in this Data Set:

Below is a list of all the fields of data included in the sample data.

  • Employee ID

  • Full Name

  • Job Title

  • Gender

  • Ethnicity

  • Age

  • Hire Date

  • Annual Salary (USD)

  • Bonus %

  • Department

  • Business Unit

  • Country

  • City

  • Exit Date

Data Preview (Employee Records)

Download This Sample Data

If you would like to download this data instantly and for free, just click the download button below. The download will be in the form of a zipped file (.zip) and include both a Microsoft Excel (.xlsx) and CSV file version of the raw data.

Sales Force Example Data (Coming Soon!)

Columns in this Data Set:

Below is a list of all the fields of data included in the sample data.

  • YTD Sales

  • Commission Rate

  • Phone Number

  • Leader Name

  • Units Sold

  • Avg. Price Per Unit

  • Employee Name

  • Region

  • Office

  • Prospecting

  • Negotiating

  • Orders

Data Preview (Sales Team Data)

Company Financial Results Example Data

Columns in this Data Set:

Below is a list of all the fields of data included in the sample data.

  • Month

  • Year

  • Scenario (Actuals/Forecast/Budget)

  • Currency

  • Account

  • Department

  • Business Unit

  • Amount

Data Preview (Financial Data)

Website Traffic Example Data (Coming Soon!)

Columns in this Data Set:

Below is a list of all the fields of data included in the sample data.

  • Users

  • Bounce Rate

  • Keywords

  • Avg. SERP

  • Avg. Time on Page

  • Page URL

  • Page Title

  • Pageviews

  • Sessions

  • Social Media Traffic

Data Preview (Web Traffic)

I Hope This Microsoft Excel Article Helped!

Hopefully, you were able to find 1 or more data sets that you can use for your spreadsheet project. If you have any questions about the data I’ve compiled or suggestions on more datasets that would be useful, please let me know in the comments section below.

About The Author

Hey there! I’m Chris and I run TheSpreadsheetGuru website in my spare time. By day, I’m actually a finance professional who relies on Microsoft Excel quite heavily in the corporate world. I love taking the things I learn in the “real world” and sharing them with everyone here on this site so that you too can become a spreadsheet guru at your company.

Through my years in the corporate world, I’ve been able to pick up on opportunities to make working with Excel better and have built a variety of Excel add-ins, from inserting tickmark symbols to automating copy/pasting from Excel to PowerPoint. If you’d like to keep up to date with the latest Excel news and directly get emailed the most meaningful Excel tips I’ve learned over the years, you can sign up for my free newsletters. I hope I was able to provide you with some value today and I hope to see you back here soon!

— Chris
Founder, TheSpreadsheetGuru.com

I. Overview

1) Excel dataset means that the data source is a series of xls or xlsx files.

2) Excel files of the Project should be stored under the directory: webappswebrootWEB-INFreportlets.

You will learn
  • Creation of Excel Dataset
    • Create a file
    • Set the dataset
    • Complete the creation of datase
  • Creation of Dynamic Excel Dataset
    • Create a file
    • Set the dataset
    • Set parameters
    • Complete the creation of dataset
    • Preview effect

II. Creation of Excel Dataset

1. Create a file

Create a datasource.xls file in Excel or download it here:

 1604567817463020.png

datasource.xls

2. Set the dataset

1) After the Designer is enabled, the dataset management interface, which is at the bottom left of the Designer, is divided into two parts: one for template dataset, and the other for server dataset. Let’s take the template dataset as an example.

1604567830378025.png 

2) Select the template dataset and then click the + above it. Click File dataset.

1604567834359884.png 

3) Set the file dataset

Set the title as “Sales” on the File window that pops up.

Click the drop-down in File type and change it to Excel.

Click Select in the Local file field.

 1604568160488262.png

4) Select the datasource.xls on the window that pops up. Click Open.

1604568165446241.png 

5) CheckFirst row contains column headingsin the Setting, so that the data in the first row can be stored as the field name.

1604568170123929.png 

3. Complete the creation of dataset

1) Click Preview to confirm that all data are correct, and then click OK.

1604568175645544.gif 

2) ClickOKagain to return.

1604568184688015.png 

3) You can see that an Excel dataset is added in the template dataset list at the bottom left of the dataset management interface.

1604568191516391.png 

III. Creation of Dynamic Excel Dataset

Dynamic excel datasets can use parameters to switch different Excel files to display data.

1. Create a file

1) Create two files respectively named as 2018data.xlsx and 2019data.xlsx, which can be downloaded here.

1604568196800743.png 

1604568201562704.png 

2018data.xlsx

2019data.xlsx

2) We can add a folder named Excel under the “reportlets” directory to save these two Excel files, With the storage path being webappswebrootWEB-INFreportletsExcel

 1604568576773402.png

2. Set the dataset

1) Select the template dataset and then click the+above it. ClickFile dataset.

1604568224690629.png 

2) Set the file dataset

Set the title as Age on the File window that pops up.

Click the drop-down in File type and change it to Excel;

ClickSelectingin theLocal filefield.

 1604568228250412.png

3) Access to the Excel folder and select the file named 2018data.xlsx. ClickOpen.

 1604568232356077.png

3. Set parameters

1) Modify it in the local file path by replace 2018data with the parameter formula ${name}, and change the original path to reportlets/Excel/${name}.xlsx.

 1604568236119863.png

2) Click the Refresh button, set the parameter name, select Stringas the parameter value type, and input 2018data into the Value field,

 1604568242899582.png

3) Check First row contains column headings in the Setting, so that the data in the first row can be stored as the field name.

 1604568247543780.png

4. Complete the creation of dataset

1) Click Preview without modifying the parameter value, and then ClickOK. Confirm that all data are correct, and then click OK.

 1604568251113547.gif

2) Click OKagain to return.

 1604568254480343.png

3) You can see that a dynamic Excel dataset is added in the template dataset list at the bottom left of the dataset management interface.

 1604568257164923.png

5. Preview effect

1) Select all the fields in the Age Dataset, drag them to Cell A2. The menu bar will appear. Select From left to right.

 1604568260627432.png

2) Input titles in the title row and adjust the cell style.

 1604568263287807.png

3) Save the templates and select Pagination Preview.

 1604568267882790.png

4) The preview result shows that the default Excel data is the data of the file named 2018data.

 1604568272419059.png

5) We can input the parameter &name=2019dataafter the URL to transfer the parameters, then click the Refresh, and switch different data of Excel files.

 1604568276474623.png

Dataset to excel file CSharp NET Core

Today, in this article we shall cover simple use cases where we will be connecting the SQL server then we will Export Dataset To Excel file C# .NET examples.

In our last post, we saw the usage of OpenXML SDK (open source SDK from Microsoft) to work with Office Word, Excel, and PowerPoint. We looked at the basic read and write of an excel file using C# in .NET or .NET Core.

Today in this article, we will cover below aspects,

  • Getting Started
  • Connecting SQL Server

Getting Started

Let’s create a .NET Core project, you can choose any project template. Here we shall use the .NET Core 3.1 Console project.

Please install latest available OpenXML Nuget package,

PM> Install-Package Open-XML-SDK -Version 2.11.3

Or

Please install package from Nuget Package Manager,

Export Dataset to excel file CSharp NET Core

Connecting SQL Server

Let’s now connect the SQL server and get the data filled as DataSet.

I have already discussed how to connect to the SQL server using SQLClient or EFCore in the below article.

  • Connect SQL Server ADO.NET C# Example
  • Getting Started with EFCore in ASP.NET Core

Please use below method which takes Dataset as input and save the each table as separate sheet in the excel sheet.

   public static void SaveDataSetAsExcel(DataSet dataset, string excelFilePath)
        {
            using (SpreadsheetDocument document = SpreadsheetDocument.Create(excelFilePath, SpreadsheetDocumentType.Workbook))
            {
                WorkbookPart workbookPart = document.AddWorkbookPart();
                workbookPart.Workbook = new Workbook();
                Sheets sheets = workbookPart.Workbook.AppendChild(new Sheets());

                foreach (DataTable table in dataset.Tables)
                {
                    UInt32Value sheetCount = 0;
                    sheetCount++;

                    WorksheetPart worksheetPart = workbookPart.AddNewPart<WorksheetPart>();

                    var sheetData = new SheetData();
                    worksheetPart.Worksheet = new Worksheet(sheetData);

                    Sheet sheet = new Sheet() { Id = workbookPart.GetIdOfPart(worksheetPart), SheetId = sheetCount, Name = table.TableName };
                    sheets.AppendChild(sheet);

                    Row headerRow = new Row();

                    List<string> columns = new List<string>();
                    foreach (System.Data.DataColumn column in table.Columns)
                    {
                        columns.Add(column.ColumnName);

                        Cell cell = new Cell();
                        cell.DataType = CellValues.String;
                        cell.CellValue = new CellValue(column.ColumnName);
                        headerRow.AppendChild(cell);
                    }

                    sheetData.AppendChild(headerRow);

                    foreach (DataRow dsrow in table.Rows)
                    {
                        Row newRow = new Row();
                        foreach (String col in columns)
                        {
                            Cell cell = new Cell();
                            cell.DataType = CellValues.String;
                            cell.CellValue = new CellValue(dsrow[col].ToString());
                            newRow.AppendChild(cell);
                        }

                        sheetData.AppendChild(newRow);
                    }



                }
                workbookPart.Workbook.Save();
        }

Finally, you shall see all the tables in the Dataset are saved as different tabs in the excel file.

Save Dataset as excel file

In the above code, we are creating each sheet as a table name and its data.

save Dataset as excel file CSharp NET Core

References:

  • Read Excel as JSON using OpenXML SDK

That’s all! Happy coding!

Does this help you fix your issue?

Do you have any better solutions or suggestions? Please sound off your comments below.


Please bookmark this page and share it with your friends. Please Subscribe to the blog to receive notifications on freshly published best practices and guidelines for software design and development.



The following examples shows how you can export a DataTable object to an Excel sheet or a DataSet object to an Excel file in C# and VB.NET.

GemBox.Spreadsheet uses the same API for all spreadsheet file formats (XLS, XLSX, ODS, CSV), so you can use the same code for filling customer files or your templates of various file formats with different data sources, such as DataTable or DataSet.

Export DataTable to Excel sheet

To insert a DataTable in an Excel sheet simply call the InsertDataTable method. You can use the InsertDataTableOptions to set various options for exporting data from DataTable to ExcelWorksheet such as:

  • ColumnHeaders — Defines whether to insert column headers.
  • StartRow and StartColumn — Define the position where to insert DataTable.
  • DataTableCellToExcelCellConverting — An event that fires when converting a DataTable cell value to an ExcelCell value which you can use to apply settings such as cell style.

Try exporting a DataTable online

You can test inserting a DataTable to an empty file with the interactive example below. Just choose an output file format, click Run Example, and download the generated file.

The example creates a DataTable, fills it with data, inserts it into an Excel file and saves The Excel file to a file format of your choice. After clicking on Run example, the C#/VB.NET code will be compiled and executed with only .NET framework and the GemBox.Spreadsheet component.

DataTable data to Excel sheet with GemBox.Spreadsheet

Screenshot of DataTable exported to Excel sheet with GemBox.Spreadsheet
using System.Data;
using GemBox.Spreadsheet;

class Program
{
    static void Main()
    {
        // If you are using the Professional version, enter your serial key below.
        SpreadsheetInfo.SetLicense("FREE-LIMITED-KEY");

        var workbook = new ExcelFile();
        var worksheet = workbook.Worksheets.Add("DataTable to Sheet");

        var dataTable = new DataTable();

        dataTable.Columns.Add("ID", typeof(int));
        dataTable.Columns.Add("FirstName", typeof(string));
        dataTable.Columns.Add("LastName", typeof(string));

        dataTable.Rows.Add(new object[] { 100, "John", "Doe" });
        dataTable.Rows.Add(new object[] { 101, "Fred", "Nurk" });
        dataTable.Rows.Add(new object[] { 103, "Hans", "Meier" });
        dataTable.Rows.Add(new object[] { 104, "Ivan", "Horvat" });
        dataTable.Rows.Add(new object[] { 105, "Jean", "Dupont" });
        dataTable.Rows.Add(new object[] { 106, "Mario", "Rossi" });

        worksheet.Cells[0, 0].Value = "DataTable insert example:";

        // Insert DataTable to an Excel worksheet.
        worksheet.InsertDataTable(dataTable,
            new InsertDataTableOptions()
            {
                ColumnHeaders = true,
                StartRow = 2
            });

        workbook.Save("DataTable to Sheet.%OutputFileType%");
    }
}
Imports System.Data
Imports GemBox.Spreadsheet

Module Program

    Sub Main()

        ' If you are using the Professional version, enter your serial key below.
        SpreadsheetInfo.SetLicense("FREE-LIMITED-KEY")

        Dim workbook = New ExcelFile
        Dim worksheet = workbook.Worksheets.Add("DataTable to Sheet")

        Dim dataTable = New DataTable

        dataTable.Columns.Add("ID", Type.GetType("System.Int32"))
        dataTable.Columns.Add("FirstName", Type.GetType("System.String"))
        dataTable.Columns.Add("LastName", Type.GetType("System.String"))

        dataTable.Rows.Add(New Object() {100, "John", "Doe"})
        dataTable.Rows.Add(New Object() {101, "Fred", "Nurk"})
        dataTable.Rows.Add(New Object() {103, "Hans", "Meier"})
        dataTable.Rows.Add(New Object() {104, "Ivan", "Horvat"})
        dataTable.Rows.Add(New Object() {105, "Jean", "Dupont"})
        dataTable.Rows.Add(New Object() {106, "Mario", "Rossi"})

        worksheet.Cells(0, 0).Value = "DataTable insert example:"

        ' Insert DataTable to an Excel worksheet.
        worksheet.InsertDataTable(dataTable,
            New InsertDataTableOptions() With
            {
                .ColumnHeaders = True,
                .StartRow = 2
            })

        workbook.Save("DataTable to Sheet.%OutputFileType%")
    End Sub
End Module

Export DataTable performance

Since GemBox.Spreadsheet is completely written in C# and uses caching techniques, it offers both speed and memory optimizations. Your users will not need to wait for their reports to be generated any more. With GemBox.Spreadsheet you can read and write 1,000,000 rows with less than 256MB RAM and less than 4 seconds. You can try the performance yourself with the Performance example.

Export DataSet to Excel file

The following example shows how you can export a DataSet object to an Excel file in C# or VB.NET.

The process is similar to exporting a DataTable to a sheet. The only difference is that you need to iterate through every DataTable in a DataSet and for each DataTable you should first create an empty sheet, and after that you should insert the DataTable into the sheet.

Try exporting DataSet online

You can test inserting a DataSet to an empty file with the interactive example below. Just choose an output file format, click Run Example, and download the generated file.

The example creates a DataSet, fills it with data, inserts it into an Excel file and saves The Excel file to a file format of your choice. After clicking on Run example, the C#/VB.NET code will be compiled and executed with only .NET framework and the GemBox.Spreadsheet component.

DataSet to Excel file with GemBox.Spreadsheet

Screenshot of DataSet exported to Excel file with GemBox.Spreadsheet
using System.Data;
using GemBox.Spreadsheet;

class Program
{
    static void Main()
    {
        // If you are using the Professional version, enter your serial key below.
        SpreadsheetInfo.SetLicense("FREE-LIMITED-KEY");

        // Create test DataSet with five DataTables
        DataSet dataSet = new DataSet();
        for (int i = 0; i < 5; i++)
        {
            DataTable dataTable = new DataTable("Table " + (i + 1));
            dataTable.Columns.Add("ID", typeof(int));
            dataTable.Columns.Add("FirstName", typeof(string));
            dataTable.Columns.Add("LastName", typeof(string));

            dataTable.Rows.Add(new object[] { 100, "John", "Doe" });
            dataTable.Rows.Add(new object[] { 101, "Fred", "Nurk" });
            dataTable.Rows.Add(new object[] { 103, "Hans", "Meier" });
            dataTable.Rows.Add(new object[] { 104, "Ivan", "Horvat" });
            dataTable.Rows.Add(new object[] { 105, "Jean", "Dupont" });
            dataTable.Rows.Add(new object[] { 106, "Mario", "Rossi" });

            dataSet.Tables.Add(dataTable);
        }

        // Create and fill a sheet for every DataTable in a DataSet
        var workbook = new ExcelFile();
        foreach (DataTable dataTable in dataSet.Tables)
        {
            ExcelWorksheet worksheet = workbook.Worksheets.Add(dataTable.TableName);

            // Insert DataTable to an Excel worksheet.
            worksheet.InsertDataTable(dataTable,
                new InsertDataTableOptions()
                {
                    ColumnHeaders = true
                });
        }

        workbook.Save("DataSet to Excel file.%OutputFileType%");
    }
}
Imports System.Data
Imports GemBox.Spreadsheet

Module Program

    Sub Main()

        ' If you are using the Professional version, enter your serial key below.
        SpreadsheetInfo.SetLicense("FREE-LIMITED-KEY")

        ' Create test DataSet with five DataTables
        Dim dataSet = New DataSet
        For value As Integer = 0 To 4
            Dim dataTable = New DataTable

            dataTable.Columns.Add("ID", Type.GetType("System.Int32"))
            dataTable.Columns.Add("FirstName", Type.GetType("System.String"))
            dataTable.Columns.Add("LastName", Type.GetType("System.String"))

            dataTable.Rows.Add(New Object() {100, "John", "Doe"})
            dataTable.Rows.Add(New Object() {101, "Fred", "Nurk"})
            dataTable.Rows.Add(New Object() {103, "Hans", "Meier"})
            dataTable.Rows.Add(New Object() {104, "Ivan", "Horvat"})
            dataTable.Rows.Add(New Object() {105, "Jean", "Dupont"})
            dataTable.Rows.Add(New Object() {106, "Mario", "Rossi"})

            dataSet.Tables.Add(dataTable)
        Next

        ' Create and fill a sheet for every DataTable in a DataSet
        Dim workbook = New ExcelFile
        For Each dataTable As DataTable In dataSet.Tables
            Dim worksheet = workbook.Worksheets.Add(dataTable.TableName)

            ' Insert DataTable to an Excel worksheet.
            worksheet.InsertDataTable(dataTable,
                New InsertDataTableOptions() With
                {
                    .ColumnHeaders = True
                })
        Next

        workbook.Save("DataSet to Excel file.%OutputFileType%")
    End Sub
End Module

Supported Excel file formats

With GemBox.Spreadsheet you can also write the following file formats using the same API: XLSX, XLS, PDF, HTML, MHTML, ODS, CSV, TXT, XLSM, XLTX, XLTM, XPS, PNG, JPEG, GIF, BMP, TIFF, WMP.

Понравилась статья? Поделить с друзьями:
  • Data samples for excel
  • Data provider with excel
  • Dance comes from the word
  • Dance all over the word
  • Data processing with excel