Skip to content

Commit 5d33b54

Browse files
Merge pull request #2152 from syncfusion-content/development
Development to master Branch merging
2 parents 131d147 + 58a03ab commit 5d33b54

137 files changed

Lines changed: 13949 additions & 4382 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

Document-Processing-toc.html

Lines changed: 72 additions & 52 deletions
Large diffs are not rendered by default.

Document-Processing/Excel/Excel-Library/NET/FAQ.md

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -62,13 +62,13 @@ The frequently asked questions in Essential<sup>&reg;</sup> XlsIO are listed bel
6262
* [How to search a value in only specific columns of an Excel worksheet?](faqs/how-to-search-a-value-in-only-specific-columns-of-an-Excel-worksheet)
6363
* [How to read filtered rows in Excel?](faqs/how-to-read-filtered-rows-in-excel)
6464
* [What are the deprecated APIs in XlsIO?](faqs/what-are-the-deprecated-apis-in-xlsio)
65-
* [How to detect merged cells in Excel?](faqs/how-to-detect-merged-cells-in-Excel)
66-
* [How to apply formatting to pivot table in Excel protected view?](faqs/how-to-apply-formatting-to-pivottable-in-Excel-protected-view)
65+
* [How to detect merged cells in Excel?](faqs/how-to-detect-merged-cells-in-excel)
66+
* [How to apply formatting to pivot table in Excel protected view?](faqs/how-to-apply-formatting-to-pivottable-in-excel-protected-view)
6767
* [Does XlsIO library support multithreading and thread-safe?](faqs/does-xlsio-support-multi-threading)
6868
* [How to check whether the given range is valid or not?](faqs/how-to-check-whether-the-given-range-is-valid-or-not)
6969
* [How to convert hidden worksheets alone to image?](faqs/how-to-convert-hidden-worksheets-alone-to-image)
7070
* [How to find and highlight data in Excel?](faqs/how-to-find-and-highlight-data-in-Excel)
71-
* [How to avoid header row while sorting Excel data?](faqs/how-to-avoid-header-row-while-sorting-Excel-data)
71+
* [How to avoid header row while sorting Excel data?](faqs/how-to-avoid-header-row-while-sorting-excel-data)
7272
* [How to edit external workbook reference link?](faqs/how-to-edit-external-workbook-reference-link)
7373
* [How to set error bars in chart?](faqs/how-to-set-error-bars-in-chart)
7474
* [Migrate XlsIO library from .NET Framework to .NET Core?](faqs/migrate-from-net-framework-to-net-core)
@@ -92,37 +92,37 @@ The frequently asked questions in Essential<sup>&reg;</sup> XlsIO are listed bel
9292
* [How to convert a value from pixel to points with scaling percentage?](faqs/how-to-convert-a-value-from-pixel-to-points-with-scaling-percentage)
9393
* [How to save the edited changes in the same Excel document?](faqs/how-to-save-the-edited-chages-in-the-same-excel-document)
9494
* [How to get the frozen rows and columns in an Excel document?](faqs/how-to-get-the-frozen-rows-and-columns-in-an-excel-document)
95-
* [How to find duplicate values in the Excel document using formulas?](faqs/how-to-find-duplicate-values-in-the-Excel-document-using-formulas)
95+
* [How to find duplicate values in the Excel document using formulas?](faqs/how-to-find-duplicate-values-in-the-excel-document-using-formulas)
9696
* [How to protect zip file items with different passwords using C#?](faqs/how-to-protect-zip-file-items-with-different-passwords)
9797
* [How to extract and save images from an Excel worksheet](faqs/how-to-extract-and-save-images-from-the-worksheet)
9898
* [How to delete blank rows and blank columns in an Excel worksheet using C#?](faqs/how-to-delete-blank-rows-and-columns-in-a-worksheet)
99-
* [How to retain cell values after removing formulas in Excel?](faqs/How-to-retain-cell-values-after-removing-formulas-in-Excel)
99+
* [How to retain cell values after removing formulas in Excel?](faqs/how-to-retain-cell-values-after-removing-formulas-in-excel)
100100
* [How to remove data validation from the specified range?](faqs/how-to-remove-data-validation-from-the-specified-range)
101101
* [How to remove autofilter from an Excel worksheet?](faqs/how-to-remove-autofilter-in-an-Excel)
102-
* [How to convert an Excel worksheet to a high-resolution image?](faqs/how-to-convert-an-Excel-worksheet-to-a-high-resolution-image)
102+
* [How to convert an Excel worksheet to a high-resolution image?](faqs/how-to-convert-an-excel-worksheet-to-a-high-resolution-image)
103103
* [How to add and remove page breaks in a worksheet?](faqs/how-to-add-and-remove-page-breaks-in-Excel)
104104
* [How to decrypt individual items with specific passwords?](faqs/how-to-decrypt-individual-items-with-specific-passwords-in-a-protected-zip-file)
105105
* [What is the behavior of FitToPagesTall and FitToPagesWide?](faqs/what-is-the-behavior-of-fittopagestall-and-fittopageswide)
106106
* [How to use AND and OR operators in the filter?](faqs/how-to-use-and-or-operators-in-the-filters)
107107
* [Why out of memory exception is thrown when handling large documents which is having size more than 2GB?](faqs/why-out-of-memory-exception-is-thrown-when-handling-large-documents)
108108
* [Does XlsIO support the multiline header footer support?](faqs/does-xlsio-support-the-multiline-header-footer-support)
109-
* [How to add Barcode in Excel document using C#?](faqs/how-to-add-Barcode-in-Excel-document)
109+
* [How to add Barcode in Excel document using C#?](faqs/how-to-add-barcode-in-excel-document)
110110
* [How to delete hyperlinks from a worksheet without affecting the cell styles using C#?](faqs/how-to-delete-hyperlinks-from-worksheet-without-affecting-the-cell-styles)
111111
* [How to avoid processing unnecessary worksheets when opening an Excel document using C#?](faqs/how-to-avoid-processing-unnecessary-worksheets-when-opening-an-Excel-document-using-C#)
112112
* [How to run macros in Excel document?](faqs/how-to-run-macros-in-Excel-document)
113113
* [Does XlsIO support editing an Excel document that is already open in Microsoft Excel?](faqs/does-xlsio-support-editing-an-Excel-document-that-is-already-open-in-Microsoft-Excel)
114114
* [How to compute the size of the Excel file?](faqs/how-to-compute-the-size-of-the-Excel-file)
115-
* [How to set and format time values in Excel using TimeSpan?](faqs/how-to-set-and-format-time-values-in-Excel-using-TimeSpan)
115+
* [How to set and format time values in Excel using TimeSpan?](faqs/how-to-set-and-format-time-values-in-excel-using-timespan)
116116
* [How to set the default font and font size in an Excel Workbook?](faqs/how-to-set-the-default-font-and-font-size-in-an-Excel-workbook)
117117
* [How to set traffic lights icon in Excel conditional formatting using C#?](faqs/how-to-set-traffic-lights-icon-in-Excel-conditional-formatting-using-C#)
118118
* [How to apply TimePeriod conditional formatting in Excel using C#?](faqs/how-to-apply-TimePeriod-conditional-formatting-in-Excel)
119119
* [How to get the list of worksheet names in an Excel workbook?](faqs/how-to-get-the-list-of-worksheet-names-in-an-Excel-workbook)
120-
* [How to switch chart series data interpretation from horizontal (rows) to vertical (columns) in Excel?](faqs/how-to-switch-chart-series-data-interpretation-from-horizontal-(rows)-to-vertical-(columns)-in-Excel)
121-
* [How to add Oval shape to Excel chart using XlsIO?](faqs/how-to-add-oval-shape-to-Excel-chart)
122-
* [How to show the leader line on Excel chart?](faqs/how-to-show-the-leader-line-on-Excel-chart)
120+
* [How to switch chart series data interpretation from horizontal (rows) to vertical (columns) in Excel?](faqs/how-to-switch-chart-series-data-interpretation-from-horizontal-(rows)-to-vertical-(columns)-in-excel)
121+
* [How to add Oval shape to Excel chart using XlsIO?](faqs/how-to-add-oval-shape-to-excel-chart)
122+
* [How to show the leader line on Excel chart?](faqs/how-to-show-the-leader-line-on-excel-chart)
123123
* [How to set the background color for Excel Chart in C#?](faqs/how-to-set-the-background-color-for-Excel-chart-in-C#)
124124
* [How to override an Excel document using C#?](faqs/how-to-override-an-Excel-document-using-C#)
125125
* [Does XlsIO support converting an empty Excel document to PDF?](faqs/does-xlsio-support-converting-an-empty-Excel-document-to-PDF)
126-
* [What is the maximum supported text length for data validation in Excel?](faqs/what-is-the-maximum-supported-text-length-for-data-validation-in-Excel)
126+
* [What is the maximum supported text length for data validation in Excel?](faqs/what-is-the-maximum-supported-text-length-for-data-validation-in-excel)
127127
* [How to set column width for a pivot table range in an Excel Document?](faqs/how-to-set-column-width-for-a-pivot-table-range-in-an-Excel-Document)
128128
* [How to convert JSON document to CSV format document?](faqs/how-to-convert-json-document-to-csv-format-document)

Document-Processing/Excel/Excel-Library/NET/Import-Export/Import-to-Excel.md

Lines changed: 19 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -75,6 +75,24 @@ A complete working example to import data from DataTable to Excel in C# is prese
7575

7676
N> XlsIO imports the data from data table into Excel worksheet based on the data table column type. So, it is suggested to create the data tables with required column types such as number, text or date time before importing the data table to Excel worksheet.
7777

78+
### Preserve Data Types
79+
80+
To preserve data types when importing a DataTable into an Excel worksheet, set the **preserveTypes** parameter of the <a href="https://help.syncfusion.com/cr/document-processing/Syncfusion.XlsIO.IWorksheet.html#Syncfusion_XlsIO_IWorksheet_ImportDataTable_System_Data_DataTable_System_Boolean_System_Int32_System_Int32_System_Boolean_">ImportDataTable</a> method to **true**.
81+
82+
{% tabs %}
83+
{% highlight c# tabtitle="C# [Cross-platform]" %}
84+
worksheet.ImportDataTable(table, false, 1, 1, true); // preserveTypes = true
85+
{% endhighlight %}
86+
87+
{% highlight c# tabtitle="C# [Windows-specific]" %}
88+
worksheet.ImportDataTable(table, false, 1, 1, true); // preserveTypes = true
89+
{% endhighlight %}
90+
91+
{% highlight vb.net tabtitle="VB.NET [Windows-specific]" %}
92+
worksheet.ImportDataTable(table, False, 1, 1, True) ' preserveTypes = True
93+
{% endhighlight %}
94+
{% endtabs %}
95+
7896
## DataColumn to Excel
7997

8098
The following code example illustrates how to import DataColumn into an Excel using [ImportDataColumn](https://help.syncfusion.com/cr/document-processing/Syncfusion.XlsIO.IWorksheet.html#Syncfusion_XlsIO_IWorksheet_ImportDataColumn_System_Data_DataColumn_System_Boolean_System_Int32_System_Int32_) method.
@@ -2609,4 +2627,4 @@ Using excelEngine As ExcelEngine = New ExcelEngine()
26092627
workbook.SaveAs("Output.xlsx")
26102628
End Using
26112629
{% endhighlight %}
2612-
{% endtabs %}
2630+
{% endtabs %}

Document-Processing/Excel/Excel-Library/NET/Working-with-Drawing-Objects.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -924,6 +924,9 @@ A complete working example to remove comment in C# is present on [this GitHub pa
924924

925925
Threaded comments are a way to add and organize annotations or discussions related to specific cells in a worksheet. [IThreadedComment](https://help.syncfusion.com/cr/document-processing/Syncfusion.XlsIO.IThreadedComment.html) object represents a threaded comment in a worksheet.
926926

927+
To quickly learn how to add, reply to, resolve, delete, and clear threaded comments in Excel documents, check out this video.
928+
{% youtube "https://www.youtube.com/watch?v=h8x62gZLxng" %}
929+
927930
### Create
928931

929932
The following code explains how to create a threaded comment for a specific cell using [AddThreadedComment](https://help.syncfusion.com/cr/document-processing/Syncfusion.XlsIO.IRange.html#Syncfusion_XlsIO_IRange_AddThreadedComment_System_String_System_String_System_DateTime_) method.
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
---
2+
title: Support for changing icon set colors in Excel | Syncfusion
3+
description: This page explains whether Syncfusion XlsIO supports changing the colors of built-in icon sets in Excel using the Syncfusion .NET Excel library (XlsIO).
4+
platform: document-processing
5+
control: XlsIO
6+
documentation: UG
7+
---
8+
9+
# Does XlsIO support changing the colors of built-in icon sets?
10+
11+
No. In Microsoft Excel, the colors of built-in icon sets used in conditional formatting (such as arrows, traffic lights, and symbols) are fixed and cannot be customized. XlsIO follows the same behavior and does not provide support for changing these icon colors programmatically. You can apply icon sets and configure their thresholds through conditional formatting, but the icon colors remain predefined by Excel.
Lines changed: 104 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,104 @@
1+
---
2+
title: How to apply styles to an Entire Excel Worksheet | Syncfusion
3+
description: Learn how to apply font settings and fill color to an entire Excel worksheet using the Syncfusion .NET Excel library (XlsIO) in C# and VB.NET.
4+
platform: document-processing
5+
control: XlsIO
6+
documentation: UG
7+
---
8+
9+
# How to apply styles to the entire worksheet in Excel?
10+
11+
The following examples show how to apply font attributes (name and size) and fill color to an entire worksheet using C# (cross-platform and Windows-specific) and VB.NET.
12+
13+
{% tabs %}
14+
{% highlight c# tabtitle="C# [Cross-platform]" %}
15+
using (ExcelEngine excelEngine = new ExcelEngine())
16+
{
17+
IApplication application = excelEngine.Excel;
18+
application.DefaultVersion = ExcelVersion.Xlsx;
19+
IWorkbook workbook = application.Workbooks.Open("../../../Data/Input.xlsx", ExcelOpenType.Automatic);
20+
IWorksheet worksheet = workbook.Worksheets[0];
21+
22+
//Define new styles to apply in rows and columns
23+
IStyle columnStyle = workbook.Styles.Add("ColumnStyle");
24+
columnStyle.Font.FontName = "Times New Roman";
25+
columnStyle.Font.Size = 10;
26+
columnStyle.Color = Color.Pink;
27+
28+
worksheet.SetDefaultColumnStyle(1, 16384, columnStyle);
29+
30+
//Save the Excel document
31+
workbook.SaveAs("../../../Output/FontStyle.xlsx");
32+
}
33+
{% endhighlight %}
34+
35+
{% highlight c# tabtitle="C# [Windows-specific]" %}
36+
using (ExcelEngine excelEngine = new ExcelEngine())
37+
{
38+
IApplication application = excelEngine.Excel;
39+
application.DefaultVersion = ExcelVersion.Xlsx;
40+
IWorkbook workbook = application.Workbooks.Open("../../Data/Input.xlsx", ExcelOpenType.Automatic);
41+
IWorksheet worksheet = workbook.Worksheets[0];
42+
43+
//Define new styles to apply in rows and columns
44+
IStyle columnStyle = workbook.Styles.Add("ColumnStyle");
45+
columnStyle.Font.FontName = "Times New Roman";
46+
columnStyle.Font.Size = 10;
47+
columnStyle.Color = Color.Pink;
48+
49+
worksheet.SetDefaultColumnStyle(1, 16384, columnStyle);
50+
51+
//Save the Excel document
52+
workbook.SaveAs("../../Output/FontStyle.xlsx");
53+
54+
}
55+
{% endhighlight %}
56+
57+
{% highlight vb.net tabtitle="VB.NET [Windows-specific]" %}
58+
Using excelEngine As New ExcelEngine()
59+
Dim application As IApplication = excelEngine.Excel
60+
application.DefaultVersion = ExcelVersion.Xlsx
61+
62+
Dim workbook As IWorkbook = application.Workbooks.Open("../../Data/Input.xlsx", ExcelOpenType.Automatic)
63+
Dim worksheet As IWorksheet = workbook.Worksheets(0)
64+
65+
'Define new styles to apply in rows and columns
66+
Dim columnStyle As IStyle = workbook.Styles.Add("ColumnStyle")
67+
columnStyle.Font.FontName = "Times New Roman"
68+
columnStyle.Font.Size = 10
69+
columnStyle.Color = Color.Pink
70+
71+
worksheet.SetDefaultColumnStyle(1, 16384, columnStyle)
72+
73+
'Save the Excel document
74+
workbook.SaveAs("../../Output/FontStyle.xlsx")
75+
End Using
76+
{% endhighlight %}
77+
{% endtabs %}
78+
79+
N>
80+
* Applying a default style to cells replaces any existing styles. This is standard Excel behavior.
81+
* To add new styling without removing existing formats, set specific properties on targeted ranges.
82+
83+
The following code snippet shows how to apply a new style without affecting existing styles:
84+
85+
{% tabs %}
86+
{% highlight c# tabtitle="C# [Cross-platform]" %}
87+
worksheet.Range["A1:F13"].CellStyle.Font.FontName = "Times New Roman";
88+
worksheet.Range["A1:F13"].CellStyle.Font.Size = 10;
89+
worksheet.Range["A1:F13"].CellStyle.Color = Color.Lavender;
90+
{% endhighlight %}
91+
92+
{% highlight c# tabtitle="C# [Windows-specific]" %}
93+
worksheet.Range["A1:F13"].CellStyle.Font.FontName = "Times New Roman";
94+
worksheet.Range["A1:F13"].CellStyle.Font.Size = 10;
95+
worksheet.Range["A1:F13"].CellStyle.Color = Color.Lavender;
96+
{% endhighlight %}
97+
98+
{% highlight vb.net tabtitle="VB.NET [Windows-specific]" %}
99+
worksheet.Range("A1:F13").CellStyle.Font.FontName = "Times New Roman"
100+
worksheet.Range("A1:F13").CellStyle.Font.Size = 10
101+
worksheet.Range("A1:F13").CellStyle.Color = Color.Lavender
102+
{% endhighlight %}
103+
{% endtabs %}
104+
Lines changed: 89 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,89 @@
1+
---
2+
title: Retrieve the first cell in the used range in Excel | Syncfusion
3+
description: Code example to retrieve the first cell in the used range in an Excel worksheet using Syncfusion .NET Excel library (XlsIO).
4+
platform: document-processing
5+
control: XlsIO
6+
documentation: UG
7+
---
8+
9+
# How to retrieve the first cell in the used range in Excel?
10+
11+
The following code examples demonstrate retrieving the first cell in the used range of an Excel worksheet using C# (Cross-platform and Windows-specific) and VB.NET.
12+
13+
{% tabs %}
14+
{% highlight c# tabtitle="C# [Cross-platform]" playgroundButtonLink="https://raw.githubusercontent.com/SyncfusionExamples/XlsIO-Examples/master/FAQ/First%20used%20cell%20in%20used%20range/.NET/FirstUsedCellInUsedRange/FirstUsedCellInUsedRange/Program.cs,180" %}
15+
using (ExcelEngine excelEngine = new ExcelEngine())
16+
{
17+
IApplication application = excelEngine.Excel;
18+
application.DefaultVersion = ExcelVersion.Xlsx;
19+
IWorkbook workbook = application.Workbooks.Open(Path.GetFullPath(@"Data/Input.xlsx"));
20+
IWorksheet worksheet = workbook.Worksheets[0];
21+
22+
//Get the used range of the worksheet
23+
IRange usedRange = worksheet.UsedRange;
24+
25+
//Get the first cell from the used range
26+
IRange firstCell = worksheet.Range[usedRange.Row, usedRange.Column];
27+
28+
//Get the address of the first cell
29+
string firstCellAddress = firstCell.AddressLocal;
30+
31+
//Display the address of the first cell
32+
Console.WriteLine("The address of the first used cell in used range is: " + firstCellAddress);
33+
34+
//Save the workbook
35+
workbook.SaveAs(Path.GetFullPath(@"Output/Output.xlsx"));
36+
}
37+
{% endhighlight %}
38+
39+
{% highlight c# tabtitle="C# [Windows-specific]" %}
40+
using (ExcelEngine excelEngine = new ExcelEngine())
41+
{
42+
IApplication application = excelEngine.Excel;
43+
application.DefaultVersion = ExcelVersion.Xlsx;
44+
IWorkbook workbook = application.Workbooks.Open("Input.xlsx");
45+
IWorksheet worksheet = workbook.Worksheets[0];
46+
47+
//Get the used range of the worksheet
48+
IRange usedRange = worksheet.UsedRange;
49+
50+
//Get the first cell from the used range
51+
IRange firstCell = worksheet.Range[usedRange.Row, usedRange.Column];
52+
53+
//Get the address of the first cell
54+
string firstCellAddress = firstCell.AddressLocal;
55+
56+
//Display the address of the first cell
57+
Console.WriteLine("The address of the first used cell in used range is: " + firstCellAddress);
58+
59+
//Save the workbook
60+
workbook.SaveAs("Output.xlsx");
61+
}
62+
{% endhighlight %}
63+
64+
{% highlight vb.net tabtitle="VB.NET [Windows-specific]" %}
65+
Using excelEngine As New ExcelEngine()
66+
Dim application As IApplication = excelEngine.Excel
67+
application.DefaultVersion = ExcelVersion.Xlsx
68+
Dim workbook As IWorkbook = application.Workbooks.Open("Input.xlsx")
69+
Dim worksheet As IWorksheet = workbook.Worksheets(0)
70+
71+
'Get the used range of the worksheet
72+
Dim usedRange As IRange = worksheet.UsedRange
73+
74+
'Get the first cell from the used range
75+
Dim firstCell As IRange = worksheet.Range(usedRange.Row, usedRange.Column)
76+
77+
'Get the address of the first cell
78+
Dim firstCellAddress As String = firstCell.AddressLocal
79+
80+
'Display the address of the first cell
81+
Console.WriteLine("The address of the first used cell in used range is: " & firstCellAddress)
82+
83+
'Save the workbook
84+
workbook.SaveAs("Output.xlsx")
85+
End Using
86+
{% endhighlight %}
87+
{% endtabs %}
88+
89+
A complete working example in C# is present on <a href="https://github.com/SyncfusionExamples/XlsIO-Examples/tree/master/FAQ/First%20used%20cell%20in%20used%20range/.NET/FirstUsedCellInUsedRange">this GitHub page</a>.

0 commit comments

Comments
 (0)