Skip to content

Commit b64456a

Browse files
Merge branch 'development' of https://github.com/syncfusion-content/document-processing-docs into API_Key_Changes-Dev
2 parents f291d28 + c48aa9e commit b64456a

311 files changed

Lines changed: 15561 additions & 4368 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: 132 additions & 55 deletions
Large diffs are not rendered by default.

Document-Processing/Excel/Conversions/Chart-to-Image/NET/Chart-to-Image-Conversion.md

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ The following code snippet shows how to convert an Excel chart to an image using
1919
{% highlight c# tabtitle="C# [Cross-platform]" playgroundButtonLink="https://raw.githubusercontent.com/SyncfusionExamples/XlsIO-Examples/master/Chart%20to%20Image/Chart%20to%20Image/.NET/Chart%20to%20Image/Chart%20to%20Image/Program.cs,180" %}
2020
using (ExcelEngine excelEngine = new ExcelEngine())
2121
{
22-
//Initialize application
22+
//Initialize application
2323
IApplication application = excelEngine.Excel;
2424

2525
//Set the default version as Xlsx
@@ -35,7 +35,8 @@ using (ExcelEngine excelEngine = new ExcelEngine())
3535
application.XlsIORenderer.ChartRenderingOptions.ScalingMode = ScalingMode.Best;
3636

3737
//Open existing workbook with chart
38-
IWorkbook workbook = application.Workbooks.Open(Path.GetFullPath(@"Data/InputTemplate.xlsx"));
38+
FileStream inputStream = new FileStream(Path.GetFullPath(@"Data/InputTemplate.xlsx"), FileMode.Open, FileAccess.Read);
39+
IWorkbook workbook = application.Workbooks.Open(inputStream);
3940
IWorksheet worksheet = workbook.Worksheets[0];
4041

4142
//Access the chart from the worksheet
@@ -49,6 +50,7 @@ using (ExcelEngine excelEngine = new ExcelEngine())
4950

5051
//Dispose streams
5152
outputStream.Dispose();
53+
inputStream.Dispose();
5254
}
5355
{% endhighlight %}
5456

Document-Processing/Excel/Excel-Library/NET/Working-with-Cell-or-Range-Formatting.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2172,4 +2172,4 @@ A complete working example to apply rich text formatting in C# is present on [th
21722172

21732173
The output of the previous code is shown as follows:
21742174

2175-
![Excel document with rich-text formatting](Working-with-Cell-or-Range-Formatting_images/Working-with-Cell-or-Range-Formatting_img6.jpeg)
2175+
![Excel document with rich-text formatting](Working-with-Cell-or-Range-Formatting_images/Working-with-Cell-or-Range-Formatting_img6.jpeg)

Document-Processing/Excel/Excel-Library/NET/Working-with-Data-Validation.md

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -129,6 +129,35 @@ A complete working example for list data validation in C# is present on [this Gi
129129

130130
N> The [ListOfValues](https://help.syncfusion.com/cr/document-processing/Syncfusion.XlsIO.IDataValidation.html#Syncfusion_XlsIO_IDataValidation_ListOfValues) property should be used when the values in the Data Validation list are entered manually whose limit is only 255 characters including separators.
131131

132+
### List Validation with User-defined Range
133+
134+
The following code snippet illustrates how to set list validation for a user-defined range.
135+
136+
{% tabs %}
137+
{% highlight c# tabtitle="C# [Cross-platform]" playgroundButtonLink="https://raw.githubusercontent.com/SyncfusionExamples/XlsIO-Examples/master/Data%20Validation/UserDefinedValidation/.NET/UserDefinedValidation/UserDefinedValidation/Program.cs,180" %}
138+
//Data validation for the user-defined range
139+
IDataValidation validation = worksheet.Range["C3"].DataValidation;
140+
validation.AllowType = ExcelDataType.User;
141+
validation.FirstFormula = "=Sheet1!$B$1:$B$3";
142+
{% endhighlight %}
143+
144+
{% highlight c# tabtitle="C# [Windows-specific]" %}
145+
//Data validation for the user-defined range
146+
IDataValidation validation = worksheet.Range["C3"].DataValidation;
147+
validation.AllowType = ExcelDataType.User;
148+
validation.FirstFormula = "=Sheet1!$B$1:$B$3";
149+
{% endhighlight %}
150+
151+
{% highlight vb.net tabtitle="VB.NET [Windows-specific]" %}
152+
'Data validation for the user-defined range
153+
Dim validation As IDataValidation = worksheet.Range("C3").DataValidation
154+
validation.AllowType = ExcelDataType.User
155+
validation.FirstFormula = "=Sheet1!$B$1:$B$3"
156+
{% endhighlight %}
157+
{% endtabs %}
158+
159+
A complete working example of list validation for a user-defined range in C# is present on <a href="https://github.com/SyncfusionExamples/XlsIO-Examples/tree/master/Data%20Validation/UserDefinedValidation/.NET/UserDefinedValidation">this GitHub page</a>.
160+
132161
## Number Validation
133162

134163
The following code snippet illustrates how to set number validation.
Lines changed: 72 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,72 @@
1+
---
2+
title: Apply a number format to an entire row in Excel | Syncfusion
3+
description: Learn how to apply a number format to an entire row in Excel using the Syncfusion .NET Excel (XlsIO) library.
4+
platform: document-processing
5+
control: XlsIO
6+
documentation: UG
7+
---
8+
9+
# How to apply a number format to an entire row in Excel?
10+
11+
The following examples illustrate how to apply a number format to an entire row in Excel in 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/Number%20format%20for%20entire%20row/.NET/Numberformatforentirerow/Numberformatforentirerow/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.Create(1);
20+
IWorksheet worksheet = workbook.Worksheets[0];
21+
22+
worksheet["A1"].Number = 1000.500;
23+
worksheet["B1"].Number = 1234;
24+
worksheet["C1"].Number = 54321.500;
25+
worksheet["D1"].Number = .500;
26+
27+
worksheet["A1"].EntireRow.NumberFormat = "#,##0.0000";
28+
29+
workbook.SaveAs("../../../Output/NumberFormats.xlsx");
30+
}
31+
{% endhighlight %}
32+
33+
{% highlight c# tabtitle="C# [Windows-specific]" %}
34+
using (ExcelEngine excelEngine = new ExcelEngine())
35+
{
36+
IApplication application = excelEngine.Excel;
37+
application.DefaultVersion = ExcelVersion.Xlsx;
38+
IWorkbook workbook = application.Workbooks.Create(1);
39+
IWorksheet worksheet = workbook.Worksheets[0];
40+
41+
worksheet["A1"].Number = 1000.500;
42+
worksheet["B1"].Number = 1234;
43+
worksheet["C1"].Number = 54321.500;
44+
worksheet["D1"].Number = .500;
45+
46+
worksheet["A1"].EntireRow.NumberFormat = "#,##0.0000";
47+
48+
workbook.SaveAs("../../Output/NumberFormats.xlsx");
49+
}
50+
{% endhighlight %}
51+
52+
{% highlight vb.net tabtitle="VB.NET [Windows-specific]" %}
53+
Using excelEngine As New ExcelEngine()
54+
Dim application As IApplication = excelEngine.Excel
55+
application.DefaultVersion = ExcelVersion.Xlsx
56+
57+
Dim workbook As IWorkbook = application.Workbooks.Create(1)
58+
Dim worksheet As IWorksheet = workbook.Worksheets(0)
59+
60+
worksheet("A1").Number = 1000.5
61+
worksheet("B1").Number = 1234
62+
worksheet("C1").Number = 54321.5
63+
worksheet("D1").Number = 0.5
64+
65+
worksheet("A1").EntireRow.NumberFormat = "#,##0.0000"
66+
67+
workbook.SaveAs("../../Output/NumberFormats.xlsx")
68+
End Using
69+
{% endhighlight %}
70+
{% endtabs %}
71+
72+
A complete working example to demonstrate how to apply a number format to an entire row in Excel using C# is present on <a href="https://github.com/SyncfusionExamples/XlsIO-Examples/tree/master/FAQ/Number%20format%20for%20entire%20row/.NET/Numberformatforentirerow">this GitHub page</a>.

Document-Processing/Excel/Excel-Library/NET/faqs/how-to-align-the-image-inside-the-cell.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,9 @@ documentation: UG
77
---
88

99
# How to align a picture inside a cell in an Excel worksheet?
10+
Image can be aligned in the cell as required using the **TopRowOffset** and **LeftColumnOffset** properties of **ShapeImpl**. In the Microsoft Excel UI, the image is dragged to the required position manually. In the same way, there are no specific values for this property. The values can only be assigned manually.
1011

11-
Image can be aligned in the cell as required using the **TopRowOffset** and **LeftColumnOffset** properties of **ShapeImpl** instance. The following example shows how to align a picture inside a worksheet cell using the Syncfusion .NET Excel (XlsIO) library.
12+
The following example shows how to align a picture inside a worksheet cell using the Syncfusion .NET Excel (XlsIO) library.
1213

1314
{% tabs %}
1415
{% highlight c# tabtitle="C# [Cross-platform]" %}
Lines changed: 101 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,101 @@
1+
---
2+
title: Apply border styles to merged cells in Excel | Syncfusion
3+
description: Learn how to apply border styles to merged cells in Excel using the Syncfusion .NET Excel (XlsIO) library.
4+
platform: document-processing
5+
control: XlsIO
6+
documentation: UG
7+
---
8+
9+
# How to apply border styles for merged cells?
10+
11+
As per the Microsoft Excel UI Behavior, while applying the styles to the single cell in the merged region, then it will apply only to that single cell. So please use the **MergeArea** property to apply the styles to the entire merged region.
12+
13+
The following examples show how to apply border styles for merged cells in C# (cross-platform and Windows-specific) and VB.NET.
14+
15+
{% tabs %}
16+
{% highlight c# tabtitle="C# [Cross-platform]" playgroundButtonLink="https://raw.githubusercontent.com/SyncfusionExamples/XlsIO-Examples/master/FAQ/Border%20styles%20for%20merged%20cells/.NET/Borderstylesformergedcells/Borderstylesformergedcells/Program.cs,180" %}
17+
using (ExcelEngine excelEngine = new ExcelEngine())
18+
{
19+
IApplication application = excelEngine.Excel;
20+
application.DefaultVersion = ExcelVersion.Xlsx;
21+
IWorkbook workbook = application.Workbooks.Open("../../../Data/Input.xlsx");
22+
IWorksheet worksheet = workbook.Worksheets[0];
23+
24+
# region Creating a new style
25+
IStyle style = workbook.Styles.Add("NewStyle");
26+
27+
style.Borders[ExcelBordersIndex.EdgeLeft].LineStyle = ExcelLineStyle.Thick;
28+
style.Borders[ExcelBordersIndex.EdgeRight].LineStyle = ExcelLineStyle.Thick;
29+
style.Borders[ExcelBordersIndex.EdgeTop].LineStyle = ExcelLineStyle.Thick;
30+
style.Borders[ExcelBordersIndex.EdgeBottom].LineStyle = ExcelLineStyle.Thick;
31+
style.Borders.Color = ExcelKnownColors.Red;
32+
33+
style.Font.Bold = true;
34+
style.Font.Color = ExcelKnownColors.Green;
35+
style.Font.Size = 24;
36+
#endregion
37+
38+
//Applying style for merged region
39+
worksheet.Range[2, 1].MergeArea.CellStyle = style;
40+
41+
workbook.SaveAs("../../../Output/MergeArea_Style.xlsx");
42+
}
43+
{% endhighlight %}
44+
45+
{% highlight c# tabtitle="C# [Windows-specific]" %}
46+
using (ExcelEngine excelEngine = new ExcelEngine())
47+
{
48+
IApplication application = excelEngine.Excel;
49+
application.DefaultVersion = ExcelVersion.Xlsx;
50+
IWorkbook workbook = application.Workbooks.Open("../../Data/Input.xlsx");
51+
IWorksheet worksheet = workbook.Worksheets[0];
52+
53+
# region Creating a new style
54+
IStyle style = workbook.Styles.Add("NewStyle");
55+
56+
style.Borders[ExcelBordersIndex.EdgeLeft].LineStyle = ExcelLineStyle.Thick;
57+
style.Borders[ExcelBordersIndex.EdgeRight].LineStyle = ExcelLineStyle.Thick;
58+
style.Borders[ExcelBordersIndex.EdgeTop].LineStyle = ExcelLineStyle.Thick;
59+
style.Borders[ExcelBordersIndex.EdgeBottom].LineStyle = ExcelLineStyle.Thick;
60+
style.Borders.Color = ExcelKnownColors.Red;
61+
62+
style.Font.Bold = true;
63+
style.Font.Color = ExcelKnownColors.Green;
64+
style.Font.Size = 24;
65+
#endregion
66+
67+
//Applying style for merged region
68+
worksheet.Range[2,1].MergeArea.CellStyle = style;
69+
70+
workbook.SaveAs("../../Output/MergeArea_Style.xlsx");
71+
}
72+
{% endhighlight %}
73+
74+
{% highlight vb.net tabtitle="VB.NET [Windows-specific]" %}
75+
Using excelEngine As New ExcelEngine()
76+
Dim application As IApplication = excelEngine.Excel
77+
application.DefaultVersion = ExcelVersion.Xlsx
78+
79+
Dim workbook As IWorkbook = application.Workbooks.Open("../../Data/Input.xlsx")
80+
Dim worksheet As IWorksheet = workbook.Worksheets(0)
81+
82+
' Creating a new style
83+
Dim style As IStyle = workbook.Styles.Add("NewStyle")
84+
style.Borders(ExcelBordersIndex.EdgeLeft).LineStyle = ExcelLineStyle.Thick
85+
style.Borders(ExcelBordersIndex.EdgeRight).LineStyle = ExcelLineStyle.Thick
86+
style.Borders(ExcelBordersIndex.EdgeTop).LineStyle = ExcelLineStyle.Thick
87+
style.Borders(ExcelBordersIndex.EdgeBottom).LineStyle = ExcelLineStyle.Thick
88+
style.Borders.Color = ExcelKnownColors.Red
89+
style.Font.Bold = True
90+
style.Font.Color = ExcelKnownColors.Green
91+
style.Font.Size = 24
92+
93+
' Applying style for merged region
94+
worksheet.Range(2, 1).MergeArea.CellStyle = style
95+
96+
workbook.SaveAs("../../Output/MergeArea_Style.xlsx")
97+
End Using
98+
{% endhighlight %}
99+
{% endtabs %}
100+
101+
A complete working example to apply border styles for merged cells using C# is present on <a href="https://github.com/SyncfusionExamples/XlsIO-Examples/tree/master/FAQ/Border%20styles%20for%20merged%20cells/.NET/Borderstylesformergedcells">this GitHub page</a>.
Lines changed: 90 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,90 @@
1+
---
2+
title: Apply Superscript to Text in an Excel Cell | Syncfusion
3+
description: Learn how to apply superscript to specific text in an Excel cell without affecting existing styles using the Syncfusion .NET Excel library (XlsIO).
4+
platform: document-processing
5+
control: XlsIO
6+
documentation: UG
7+
---
8+
9+
# How to apply superscript to certain text in a cell?
10+
11+
The following code example illustrates how to apply superscript to certain text in a cell without affecting the existing style in C# (cross-platform and Windows-specific) and VB.NET.
12+
{% tabs %}
13+
{% highlight c# tabtitle="C# [Cross-platform]" playgroundButtonLink="https://raw.githubusercontent.com/SyncfusionExamples/XlsIO-Examples/master/FAQ/Superscript/.NET/Superscript%20for%20certain%20texts/SuperscriptForCertainTexts/Program.cs,180" %}
14+
using (ExcelEngine excelEngine = new ExcelEngine())
15+
{
16+
IApplication application = excelEngine.Excel;
17+
application.DefaultVersion = ExcelVersion.Xlsx;
18+
//Create a workbook
19+
IWorkbook workbook = application.Workbooks.Open("../../../Data/Sample.xlsx");
20+
IWorksheet worksheet = workbook.Worksheets[0];
21+
22+
//Add Text
23+
IRange range = worksheet.Range["A1"];
24+
IRichTextString richText = range.RichText;
25+
26+
IFont superScript = workbook.CreateFont();
27+
superScript.Size = richText.GetFont(6).Size;
28+
superScript.FontName = richText.GetFont(6).FontName;
29+
superScript.Color = richText.GetFont(6).Color;
30+
superScript.Superscript = true;
31+
richText.SetFont(6, 6, superScript);
32+
33+
34+
//Save the workbook to disk in xlsx format
35+
workbook.SaveAs("../../../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+
//Create a workbook
45+
IWorkbook workbook = application.Workbooks.Open("../../Data/Sample.xlsx");
46+
IWorksheet worksheet = workbook.Worksheets[0];
47+
48+
//Add Text
49+
IRange range = worksheet.Range["A1"];
50+
IRichTextString richText = range.RichText;
51+
52+
IFont superScript = workbook.CreateFont();
53+
superScript.Size = richText.GetFont(6).Size;
54+
superScript.FontName = richText.GetFont(6).FontName;
55+
superScript.Color = richText.GetFont(6).Color;
56+
superScript.Superscript = true;
57+
richText.SetFont(6, 6, superScript);
58+
59+
60+
//Save the workbook to disk in xlsx format
61+
workbook.SaveAs("../../Output/Output.xlsx");
62+
}
63+
{% endhighlight %}
64+
65+
{% highlight vb.net tabtitle="VB.NET [Windows-specific]" %}
66+
Using excelEngine As New ExcelEngine()
67+
Dim application As IApplication = excelEngine.Excel
68+
application.DefaultVersion = ExcelVersion.Xlsx
69+
'Create a workbook
70+
Dim workbook As IWorkbook = application.Workbooks.Open("../../Data/Sample.xlsx")
71+
Dim worksheet As IWorksheet = workbook.Worksheets(0)
72+
73+
'Add Text
74+
Dim range As IRange = worksheet.Range("A1")
75+
Dim richText As IRichTextString = range.RichText
76+
77+
Dim superScript As IFont = workbook.CreateFont()
78+
superScript.Size = richText.GetFont(6).Size
79+
superScript.FontName = richText.GetFont(6).FontName
80+
superScript.Color = richText.GetFont(6).Color
81+
superScript.Superscript = True
82+
richText.SetFont(6, 6, superScript)
83+
84+
'Save the workbook to disk in xlsx format
85+
workbook.SaveAs("../../Output/Output.xlsx")
86+
End Using
87+
{% endhighlight %}
88+
{% endtabs %}
89+
90+
A complete working example to apply superscript to certain text in a cell using C# is present on <a href="https://github.com/SyncfusionExamples/XlsIO-Examples/tree/master/FAQ/Superscript/.NET/Superscript%20for%20certain%20texts">this GitHub page</a>.

0 commit comments

Comments
 (0)