ByteScout Spreadsheet SDK - C# - Rich Text Formatting in Cell - ByteScout

ByteScout Spreadsheet SDK – C# – Rich Text Formatting in Cell

  • Home
  • /
  • Articles
  • /
  • ByteScout Spreadsheet SDK – C# – Rich Text Formatting in Cell

ByteScout Spreadsheet SDK – C# – Rich Text Formatting in Cell

Program.cs

[csharp]
using System;
using System.Collections.Generic;
using System.Drawing;
using System.Text;
using Bytescout.Spreadsheet;
using System.Diagnostics;
using System.IO;

namespace HelloWorld
{
class Program
{
static void Main(string[] args)
{
// Create new Spreadsheet
Spreadsheet document = new Spreadsheet();

// Add new worksheet
Worksheet worksheet = document.Workbook.Worksheets.Add(“Sheet1”);

// Apply rich text formatting
worksheet.Cell(0, 0).ValueAsHTML = “Bold Underline, and bold italic text”;
worksheet.Cell(1, 0).ValueAsHTML = “Blue, Green and other colors are available“;

// delete output file if exists already
if (File.Exists(“Output.xls”)){
File.Delete(“Output.xls”);
}

// Save document
document.SaveAs(“Output.xls”);

// Close Spreadsheet
document.Close();

// open generated XLS document in default program
Process.Start(“Output.xls”);
}
}
}

[/csharp]


  Click here to get your Free Trial version of the SDK

Tutorials:

prev
next