ycliper

Популярное

Музыка Кино и Анимация Автомобили Животные Спорт Путешествия Игры Юмор

Интересные видео

2025 Сериалы Трейлеры Новости Как сделать Видеоуроки Diy своими руками

Топ запросов

смотреть а4 schoolboy runaway турецкий сериал смотреть мультфильмы эдисон
Скачать

How to Apply Line/Border Style in Excel Comment using EPPlus [Hindi]-Part 13(E)

Автор: Everyday Be Coding

Загружено: 2017-08-03

Просмотров: 175

Описание: EPPLUS Library - Beginners Guide Part-13(E)

Suggested Videos Links:
Part 8 -    • How to Create, Move, Show, Hide & Remove C...  
Part-9(A) -    • How to Change Text, Background Color and R...  
Part-10(B) -    • How to Apply Text Alignment & Font Style i...  
Part-11(C) -    • How to Add & Remove Multi Style & Multiple...  
Part-12(D) -    • How to Create Multi Style Rich Text in Exc...  
-------------------------------------------------------------------------
How to Create & Apply Line Border Color, Width & Style in an Excel Comment Using EPPlus .Net Application C# [Hindi] - Part 13(E)
-------------------------------------------------------------------------------------------------------
English Video Link :    • How to Apply Line/Border Style in Excel Co...  
-------------------------------------------------------------------------
Blog : https://everyday-be-coding.blogspot.c...
-----------------------------------------------------------------------
Twitter :   / everydaycoding  
-----------------------------------------------------------------------
Facebook:   / everydaybecoding  
---------------------------------------------------------------------------------
Source code download link: https://goo.gl/EYjAsT
---------------------------------------------------------------------------------

We need to attach one more namespace OfficeOpenXml.Drawing.Vml, because in this code we can see LineWidth, LineColor, LineStyle properties. These properties belong to ExcelVmlDrawingComment class & ExcelComment class is inherited from
ExcelVmlDrawingComment class so, that's why the object of ExcelComment class gets those properties from his base class.

Please see this below code.
using (ExcelRange Rng = wsSheet1.Cells["B15"])
{
ExcelComment cmd = Rng.AddComment("Comment Text", "Rajdip");
cmd.Font.Bold = true;
cmd.Font.Color = Color.Blue;

//Apply Line or Border Style in Excel Comment.
cmd.LineWidth = 3;
Color GreenHexCode = ColorTranslator.FromHtml("#008000");

cmd.LineColor = GreenHexCode; //Color.Green;
cmd.LineStyle = eLineStyleVml.DashDot;

cmd.Visible = true;
}

We can use custom color code by using ColorTranslator static class methods
a) FromHtml (string htmlColor),
b) FromOle (int oleColor),
c) FromWin32 (int win32Color).
return type of these methods are Color struct object.

There is another enum eLineStyleVml is used in this above code.

namespace OfficeOpenXml.Drawing.Vml
{
//
// Summary:
// Linestyle
public enum eLineStyleVml
{
Solid = 0,
Round = 1,
Square = 2,
Dash = 3,
DashDot = 4,
LongDash = 5,
LongDashDot = 6,
LongDashDotDot = 7
}
}

Here, I am using DashDot, that means 4 within enumerator list.

Full Source Code:
using OfficeOpenXml;
using System.IO;
using System.Drawing;
using OfficeOpenXml.Drawing.Vml;

namespace EpplusDemo
{
class Program
{
static void Main(string[] args)
{
//Code download from: https://everyday-be-coding.blogspot.i...
//Author: Rajdip Sarkar.
//Date : 29th July 2017.
//My YouTube Channel Link :    / @everyday-be-coding  

ExcelPackage ExcelPkg = new ExcelPackage();
ExcelWorksheet wsSheet1 = ExcelPkg.Workbook.Worksheets.Add("Sheet1");

using (ExcelRange Rng = wsSheet1.Cells[2, 2, 2, 2])
{
Rng.Value = "Everyday Be Coding - Excel COMMENTS Formatting using EPPlus .Net Library - Part 13(E)";
Rng.Style.Font.Size = 16;
Rng.Style.Font.Bold = true;
Rng.Style.Font.Italic = true;
}

using (ExcelRange Rng = wsSheet1.Cells["B5"])
{
Rng.Style.Font.Size = 20;
Rng.Value = "Excel Comment Border Style";

ExcelComment cmd = Rng.AddComment("Comment Text", "Rajdip");
cmd.Font.Bold = true;
cmd.Font.Color = Color.Blue;

//Apply Line or Border Style in Excel Comment.
cmd.LineWidth = 3;
Color GreenHexCode = ColorTranslator.FromHtml("#008000");

cmd.LineColor = GreenHexCode; //Color.Green;
cmd.LineStyle = eLineStyleVml.DashDot;

cmd.Visible = true;
}
wsSheet1.Cells[wsSheet1.Dimension.Address].AutoFitColumns();
ExcelPkg.SaveAs(new FileInfo(@"D:\FormatComments.xlsx"));
}
}
}
Now build & execute this code. The file is (FormatComments.xlsx) store on D: drive of the computer.
Thank you for reading this article.
Please subscribe my YouTube Channel & don't forget to like and share.

Не удается загрузить Youtube-плеер. Проверьте блокировку Youtube в вашей сети.
Повторяем попытку...
How to Apply Line/Border Style in Excel Comment using EPPlus [Hindi]-Part 13(E)

Поделиться в:

Доступные форматы для скачивания:

Скачать видео

  • Информация по загрузке:

Скачать аудио

Похожие видео

© 2025 ycliper. Все права защищены.



  • Контакты
  • О нас
  • Политика конфиденциальности



Контакты для правообладателей: [email protected]