ByteScout Spreadsheet SDK – C# – Export To JSON

  • Home
  • /
  • Articles
  • /
  • ByteScout Spreadsheet SDK – C# – Export To JSON

ByteScout Spreadsheet SDK – C# – Export To JSON

Program.cs

using System.Diagnostics;
using System.IO;
using Bytescout.Spreadsheet;

namespace ExportToJSON
{
    class Program
    {
        static void Main(string[] args)
        {
            using (Spreadsheet spreadsheet = new Spreadsheet())
            {
            	// Load document
                spreadsheet.LoadFromFile("Table.xls");
                
                // Export first worksheet to JSON format
                string jsonString = spreadsheet.ExportToJSON(0);
                
                // Write JSON string to file
                File.WriteAllText("exported.json.txt", jsonString);

				// Open the result file in default associated application
                Process.Start("exported.json.txt");
            }
        }
    }
}


  Click here to get your Free Trial version of the SDK

prev
next