Home
We need your feedback!

Bytescout Spreadsheet SDK for .NET
Screenshots

Click to view sample
Click to view sample
Click to view sample
Click to view sample
Click to view sample
Click to view sample
Click to view sample Click to view sample
Subscribe to Our Bi-Monthly Newsletter (tips, new releases, specials):
 Subscribe in a reader
 PRODUCTS  |  DOWNLOAD  |  PURCHASE  |  SUPPORT  |  TESTIMONIALS   |  NEWS  | 

Bytescout Spreadsheet SDK for .NET

Download Free Trial Buy Now More Information
Shop Safely: Bytescout Spreadsheet SDK comes with a 30-DAY UNCONDITIONAL MONEY-BACK GUARANTEE

How to use different line styles for cells in spreadsheet document (XLS) generated with Bytescout Spreadsheet for .NET

This source code sample demonstrates how to use different line styles for cell formatting while using Bytescout Spreadsheet SDK

Download example source code: bytescoutxls_different_line_type_styles_for_cells.zip (8 KB)

Output spreadsheet XLS document screenshot:

Different line styles for cells

using System;
using System.Collections.Generic;
using System.Text;
using System.Diagnostics;
using Bytescout.Spreadsheet;
using Bytescout.Spreadsheet.Constants;

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

// Get worksheet by name
Worksheet worksheet = document.Workbook.Worksheets.Add();

// Number of cell in the first column
int cellRow = 0;

// Apply all line styles
foreach (LineStyle lineStyle in Enum.GetValues(typeof(LineStyle)))
{
// Set current cell
Cell currentCell = worksheet.Cell(cellRow, 0);

// Set border styles
currentCell.RightBorderStyle =lineStyle;
currentCell.LeftBorderStyle = lineStyle;
currentCell.TopBorderStyle = lineStyle;
currentCell.BottomBorderStyle = lineStyle;

// Print style name
currentCell.Value = lineStyle.ToString();

// Choose next row
cellRow += 2;
}

// Save document
document.SaveAs("LineTypes.xls");

// Close document
document.Close();

// open generated XLS document in default program
Process.Start("LineTypes.xls");
}
}
}

Download example source code: bytescoutxls_different_line_type_styles_for_cells.zip (8 KB)

Download Free Trial Buy Now More Information
Shop Safely: Bytescout Spreadsheet SDK comes with a 30-DAY UNCONDITIONAL MONEY-BACK GUARANTEE

Documentation online: view (separate window)

First steps tutorials:

Advanced Examples:

HOME  |  CONTACT US

Copyright © ByteScout, 2003-2010. Privacy Statement
Microsoft®, Windows®, Windows 2000®, Windows Server®, Windows Vista®, Internet Explorer®, .NET Framework®, ActiveX®, Visual Basic®, Visual C#®, ASP®, ASP.NET®, Excel®, PowerPoint®, are either registered trademarks or trademarks of Microsoft Corporation in the United States and/or other countries. Adobe®, Flash® and Acrobat® are registered trademarks of Adobe Systems, Incorporated. Mozilla®, Firefox® and the Mozilla and Firefox Logos are registered trademarks of the Mozilla Foundation. Other product names or brandnames used herein are for identification purposes only and might be trademarks or registered trademarks of their respective companies. We disclaim any and all rights to those marks.