Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
<Solution>
<Project Path="Ordered_UnOrdered_List/Ordered_UnOrdered_List.csproj" />
</Solution>
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFramework>net8.0</TargetFramework>
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>
</PropertyGroup>

<ItemGroup>
<PackageReference Include="Syncfusion.XlsIO.Net.Core" Version="*" />
</ItemGroup>

<ItemGroup>
<None Update="Output\*">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</None>
</ItemGroup>

</Project>
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
using Syncfusion.XlsIO;

class Program
{
static void Main(string[] args)
{
using (ExcelEngine excelEngine = new ExcelEngine())
{
IApplication application = excelEngine.Excel;
application.DefaultVersion = ExcelVersion.Xlsx;

IWorkbook workbook = application.Workbooks.Create(1);
IWorksheet sheet = workbook.Worksheets[0];

// Target cell
IRange cell = sheet.Range["B3"];
IRichTextString richText = cell.RichText;

// Add initial text
richText.Text = "list:\n";

// Fonts
IFont bulletFont = workbook.CreateFont();
bulletFont.FontName = "Courier New";
bulletFont.Size = 10;

IFont textFont = workbook.CreateFont();
textFont.FontName = "Segoe UI";
textFont.Size = 10;

// First bullet
richText.Text += " • number1\n";
richText.SetFont(7, 9, bulletFont); // bullet
richText.SetFont(10, 16, textFont); // text

// Second bullet
richText.Text += " • number2\n";
richText.SetFont(18, 20, bulletFont); // bullet
richText.SetFont(21, 27, textFont); // text

// Third bullet
richText.Text += " • number3";
richText.SetFont(29, 31, bulletFont); // bullet
richText.SetFont(32, 38, textFont); // text

// Wrap text so bullets appear on separate lines
cell.CellStyle.WrapText = true;

// Save the workbook
workbook.SaveAs(Path.GetFullPath("Output/BulletedCell.xlsx"));
}
}
}
Loading