ByteScout Barcode Suite - C# - Set cell alignment with spreadsheet sdk - ByteScout

ByteScout Barcode Suite – C# – Set cell alignment with spreadsheet sdk

  • Home
  • /
  • Articles
  • /
  • ByteScout Barcode Suite – C# – Set cell alignment with spreadsheet sdk

How to set cell alignment with spreadsheet sdk in C# and ByteScout Barcode Suite

If you want to learn more then this tutorial will show how to set cell alignment with spreadsheet sdk in C#

The code displayed below will guide you to install an C# app to set cell alignment with spreadsheet sdk. ByteScout Barcode Suite can set cell alignment with spreadsheet sdk. It can be applied from 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.

Want to quickly learn? This fast application programming interfaces of ByteScout Barcode Suite for C# plus the guidelines and the code below will help you quickly learn how to set cell alignment with spreadsheet sdk. Simply copy and paste in your C# project or application you and then run your app! Check C# sample code samples to see if they respond to your needs and requirements for the project.

ByteScout provides the free trial version of ByteScout Barcode Suite along with the documentation and source code samples.

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; using System.Collections.Generic; 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("AlignmentDemo"); // Set Values worksheet.Cell("A1").Value = "Name"; // setting centered alignment for the cell worksheet.Cell("A1").AlignmentHorizontal = Bytescout.Spreadsheet.Constants.AlignmentHorizontal.Centered; worksheet.Cell("B1").Value = "Full Name"; // setting centered alignment for the cell worksheet.Cell("B1").AlignmentHorizontal = Bytescout.Spreadsheet.Constants.AlignmentHorizontal.Centered; worksheet.Cell("A2").Value = "Homer"; // setting justifiedalignment for the cell worksheet.Cell("A2").AlignmentHorizontal = Bytescout.Spreadsheet.Constants.AlignmentHorizontal.Right; worksheet.Cell("B2").Value = "Homer Jay Simpson"; // setting justified alignment for the cell worksheet.Cell("B2").AlignmentHorizontal = Bytescout.Spreadsheet.Constants.AlignmentHorizontal.Right; // set columns width worksheet.Columns[0].Width = 300; // A column worksheet.Columns[1].Width = 400; // B column // delete output file if exists already if (File.Exists("CellAlignment.xls")){ File.Delete("CellAlignment.xls"); } // Save document document.SaveAs("CellAlignment.xls"); // open XLS document in default XLS Excel documents application Process.Start("CellAlignment.xls"); } } }

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