ByteScout Barcode Suite - C# - Import from 2d array with spreadsheet sdk - ByteScout

ByteScout Barcode Suite – C# – Import from 2d array with spreadsheet sdk

  • Home
  • /
  • Articles
  • /
  • ByteScout Barcode Suite – C# – Import from 2d array with spreadsheet sdk

How to import from 2d array with spreadsheet sdk in C# and ByteScout Barcode Suite

If you want to learn more then this tutorial will show how to import from 2d array with spreadsheet sdk in C#

The sample source codes on this page shows how to import from 2d array with spreadsheet sdk in C#. ByteScout Barcode Suite is the set that includes three different SDK products to generate barcodes, read barcodes and read and write spreadsheets: Barcode SDK, Barcode Reader SDK and Spreadsheet SDK. It can be applied to import from 2d array with spreadsheet sdk using C#.

The SDK samples given below describe how to quickly make your application do import from 2d array with spreadsheet sdk in C# with the help of ByteScout Barcode Suite. This C# sample code is all you need for your app. Just copy and paste the code, add references (if needs to) and you are all set! If you want to use these C# sample examples in one or many applications then they can be used easily.

Trial version of ByteScout Barcode Suite is available for free. Source code samples are included to help you with your C# app.

On-demand (REST Web API) version:
 Web API (on-demand version)

On-premise offline SDK for Windows:
 60 Day Free Trial (on-premise)

Program.cs
      
using System.Diagnostics; using System.IO; using Bytescout.Spreadsheet; namespace Bytescout.Spreadsheet.Demo.Csharp.ImportFrom2DArray { class Program { static void Main(string[] args) { const string fileName = "CSharpImportFrom2DArray.xls"; // Create a new spreadsheet Spreadsheet spreadsheet = new Spreadsheet(); // Get the data from the 2D array that we want to import string[,] stockPrices = Get2DArray(); // Import data into spreadheet spreadsheet.ImportFrom2DArray(stockPrices); // Save the spreadsheet if (File.Exists(fileName)) File.Delete(fileName); spreadsheet.SaveAs(fileName); // Close spreadsheet spreadsheet.Close(); // Open the spreadsheet Process.Start(fileName); } /// <summary> /// Creates a 2D array of stock prices /// </summary> /// <returns>2d array of stock prices</returns> private static string[,] Get2DArray() { string[,] stockPrices = new string[10, 2]; stockPrices[0, 0] = "AAPL"; stockPrices[0, 1] = "24,89"; stockPrices[1, 0] = "AMZN"; stockPrices[1, 1] = "27,95"; stockPrices[2, 0] = "DELL"; stockPrices[2, 1] = "12,68"; stockPrices[3, 0] = "EBAY"; stockPrices[3, 1] = "57,27"; stockPrices[4, 0] = "GOOG"; stockPrices[4, 1] = "28,98"; stockPrices[5, 0] = "IBM "; stockPrices[5, 1] = "24,00"; stockPrices[6, 0] = "INTC"; stockPrices[6, 1] = "12,24"; stockPrices[7, 0] = "MSFT"; stockPrices[7, 1] = "37,85"; stockPrices[8, 0] = "SNE "; stockPrices[8, 1] = "39,91"; stockPrices[9, 0] = "YHOO"; stockPrices[9, 1] = "78,72"; return stockPrices; } } }

ON-PREMISE OFFLINE SDK

60 Day Free Trial or Visit ByteScout Barcode Suite Home Page

Explore ByteScout Barcode Suite Documentation

Explore Samples

Sign Up for ByteScout Barcode Suite Online Training

ON-DEMAND REST WEB API

Get Your API Key

Explore Web API Docs

Explore Web API Samples

VIDEO

ON-PREMISE OFFLINE SDK

60 Day Free Trial or Visit ByteScout Barcode Suite Home Page

Explore ByteScout Barcode Suite Documentation

Explore Samples

Sign Up for ByteScout Barcode Suite Online Training

ON-DEMAND REST WEB API

Get Your API Key

Explore Web API Docs

Explore Web API Samples

Tutorials:

prev
next