Skip to content

Commit fa3461a

Browse files
Merge pull request #1654 from Syncfusion-Content/hotfix/hotfix-v31.2.2
DOCINFRA-2341_merged_using_automation
2 parents 7cea7c8 + 0742e17 commit fa3461a

File tree

4 files changed

+113
-71
lines changed

4 files changed

+113
-71
lines changed

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

Lines changed: 14 additions & 68 deletions
Original file line numberDiff line numberDiff line change
@@ -33,12 +33,8 @@ using (ExcelEngine excelEngine = new ExcelEngine())
3333

3434
#region Save
3535
//Saving the workbook
36-
FileStream outputStream = new FileStream(Path.GetFullPath("Output/CreateStyle.xlsx"), FileMode.Create, FileAccess.Write);
37-
workbook.SaveAs(outputStream);
36+
workbook.SaveAs(Path.GetFullPath("Output/CreateStyle.xlsx"));
3837
#endregion
39-
40-
//Dispose streams
41-
outputStream.Dispose();
4238
}
4339
{% endhighlight %}
4440

@@ -110,12 +106,8 @@ using (ExcelEngine excelEngine = new ExcelEngine())
110106

111107
#region Save
112108
//Saving the workbook
113-
FileStream outputStream = new FileStream(Path.GetFullPath("Output/RowColumnStyle.xlsx"), FileMode.Create, FileAccess.Write);
114-
workbook.SaveAs(outputStream);
109+
workbook.SaveAs(Path.GetFullPath("Output/RowColumnStyle.xlsx"));
115110
#endregion
116-
117-
//Dispose streams
118-
outputStream.Dispose();
119111
}
120112
{% endhighlight %}
121113

@@ -257,12 +249,8 @@ using (ExcelEngine excelEngine = new ExcelEngine())
257249

258250
#region Save
259251
//Saving the workbook
260-
FileStream outputStream = new FileStream(Path.GetFullPath("Output/GlobalStyle.xlsx"), FileMode.Create, FileAccess.Write);
261-
workbook.SaveAs(outputStream);
252+
workbook.SaveAs(Path.GetFullPath("Output/GlobalStyle.xlsx"));
262253
#endregion
263-
264-
//Dispose streams
265-
outputStream.Dispose();
266254
}
267255
{% endhighlight %}
268256

@@ -687,12 +675,8 @@ using (ExcelEngine excelEngine = new ExcelEngine())
687675

688676
#region Save
689677
//Saving the workbook
690-
FileStream outputStream = new FileStream(Path.GetFullPath("Output/NumberFormat.xlsx"), FileMode.Create, FileAccess.Write);
691-
workbook.SaveAs(outputStream);
678+
workbook.SaveAs(Path.GetFullPath("Output/NumberFormat.xlsx"));
692679
#endregion
693-
694-
//Dispose streams
695-
outputStream.Dispose();
696680
}
697681
{% endhighlight %}
698682

@@ -873,9 +857,7 @@ using (ExcelEngine excelEngine = new ExcelEngine())
873857
string text = worksheet.Range["B4"].DisplayText;
874858

875859
//Saving the workbook as stream
876-
FileStream stream = new FileStream("Output.xlsx", FileMode.Create, FileAccess.ReadWrite);
877-
workbook.SaveAs(stream);
878-
stream.Dispose();
860+
workbook.SaveAs(Path.GetFullPath("Output/Output.xlsx"));
879861
}
880862
{% endhighlight %}
881863

@@ -970,12 +952,8 @@ using (ExcelEngine excelEngine = new ExcelEngine())
970952

971953
#region Save
972954
//Saving the workbook
973-
FileStream outputStream = new FileStream(Path.GetFullPath("Output/HideCellContent.xlsx"), FileMode.Create, FileAccess.Write);
974-
workbook.SaveAs(outputStream);
955+
workbook.SaveAs(Path.GetFullPath("Output/HideCellContent.xlsx"));
975956
#endregion
976-
977-
//Dispose streams
978-
outputStream.Dispose();
979957
}
980958
{% endhighlight %}
981959

@@ -1189,12 +1167,8 @@ using (ExcelEngine excelEngine = new ExcelEngine())
11891167

11901168
#region Save
11911169
//Saving the workbook
1192-
FileStream outputStream = new FileStream(Path.GetFullPath("Output/Alignment.xlsx"), FileMode.Create, FileAccess.Write);
1193-
workbook.SaveAs(outputStream);
1170+
workbook.SaveAs(Path.GetFullPath("Output/Alignment.xlsx"));
11941171
#endregion
1195-
1196-
//Dispose streams
1197-
outputStream.Dispose();
11981172
}
11991173
{% endhighlight %}
12001174

@@ -1374,12 +1348,8 @@ using (ExcelEngine excelEngine = new ExcelEngine())
13741348

13751349
#region Save
13761350
//Saving the workbook
1377-
FileStream outputStream = new FileStream(Path.GetFullPath("Output/MergeandUnMerge.xlsx"), FileMode.Create, FileAccess.Write);
1378-
workbook.SaveAs(outputStream);
1351+
workbook.SaveAs(Path.GetFullPath("Output/MergeandUnMerge.xlsx"));
13791352
#endregion
1380-
1381-
//Dispose streams
1382-
outputStream.Dispose();
13831353
}
13841354
{% endhighlight %}
13851355

@@ -1445,12 +1415,8 @@ using (ExcelEngine excelEngine = new ExcelEngine())
14451415

14461416
#region Save
14471417
//Saving the workbook
1448-
FileStream outputStream = new FileStream(Path.GetFullPath("Output/WrapText.xlsx"), FileMode.Create, FileAccess.Write);
1449-
workbook.SaveAs(outputStream);
1418+
workbook.SaveAs(Path.GetFullPath("Output/WrapText.xlsx"));
14501419
#endregion
1451-
1452-
//Dispose streams
1453-
outputStream.Dispose();
14541420
}
14551421
{% endhighlight %}
14561422

@@ -1542,12 +1508,8 @@ using (ExcelEngine excelEngine = new ExcelEngine())
15421508

15431509
#region Save
15441510
//Saving the workbook
1545-
FileStream outputStream = new FileStream(Path.GetFullPath("Output/AutoFit.xlsx"), FileMode.Create, FileAccess.Write);
1546-
workbook.SaveAs(outputStream);
1511+
workbook.SaveAs(Path.GetFullPath("Output/AutoFit.xlsx"));
15471512
#endregion
1548-
1549-
//Dispose streams
1550-
outputStream.Dispose();
15511513
}
15521514
{% endhighlight %}
15531515

@@ -1643,12 +1605,8 @@ using (ExcelEngine excelEngine = new ExcelEngine())
16431605

16441606
#region Save
16451607
//Saving the workbook
1646-
FileStream outputStream = new FileStream(Path.GetFullPath("Output/FontSettings.xlsx"), FileMode.Create, FileAccess.Write);
1647-
workbook.SaveAs(outputStream);
1608+
workbook.SaveAs(Path.GetFullPath("Output/FontSettings.xlsx"));
16481609
#endregion
1649-
1650-
//Dispose streams
1651-
outputStream.Dispose();
16521610
}
16531611
{% endhighlight %}
16541612

@@ -1860,12 +1818,8 @@ using (ExcelEngine excelEngine = new ExcelEngine())
18601818

18611819
#region Save
18621820
//Saving the workbook
1863-
FileStream outputStream = new FileStream(Path.GetFullPath("Output/BorderSettings.xlsx"), FileMode.Create, FileAccess.Write);
1864-
workbook.SaveAs(outputStream);
1821+
workbook.SaveAs(Path.GetFullPath("Output/BorderSettings.xlsx"));
18651822
#endregion
1866-
1867-
//Dispose streams
1868-
outputStream.Dispose();
18691823
}
18701824
{% endhighlight %}
18711825

@@ -1996,12 +1950,8 @@ using (ExcelEngine excelEngine = new ExcelEngine())
19961950

19971951
#region Save
19981952
//Saving the workbook
1999-
FileStream outputStream = new FileStream(Path.GetFullPath("Output/HTMLString.xlsx"), FileMode.Create, FileAccess.Write);
2000-
workbook.SaveAs(outputStream);
1953+
workbook.SaveAs(Path.GetFullPath("Output/HTMLString.xlsx"));
20011954
#endregion
2002-
2003-
//Dispose streams
2004-
outputStream.Dispose();
20051955
}
20061956
{% endhighlight %}
20071957

@@ -2105,12 +2055,8 @@ using (ExcelEngine excelEngine = new ExcelEngine())
21052055

21062056
#region Save
21072057
//Saving the workbook
2108-
FileStream outputStream = new FileStream(Path.GetFullPath("Output/RichText.xlsx"), FileMode.Create, FileAccess.Write);
2109-
workbook.SaveAs(outputStream);
2058+
workbook.SaveAs(Path.GetFullPath("Output/RichText.xlsx"));
21102059
#endregion
2111-
2112-
//Dispose streams
2113-
outputStream.Dispose();
21142060
}
21152061
{% endhighlight %}
21162062

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

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -337,9 +337,7 @@ using (ExcelEngine excelEngine = new ExcelEngine())
337337
validation.PromptBoxText = "Custom DataValidation";
338338
validation.ShowPromptBox = true;
339339

340-
FileStream file = new FileStream("DataValidation.xlsx", FileMode.Create, FileAccess.ReadWrite);
341-
workbook.SaveAs(file);
342-
file.Dispose();
340+
workbook.SaveAs("DataValidation.xlsx");
343341
}
344342
{% endhighlight %}
345343

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
---
2+
title: XlsIO support for multiple markers in a single cell | Syncfusion
3+
description: Learn whether Syncfusion XlsIO supports multiple markers in a single Excel cell using the Syncfusion .NET Excel library (XlsIO).
4+
platform: document-processing
5+
control: XlsIO
6+
documentation: UG
7+
---
8+
9+
# Does XlsIO support multiple markers in a single Excel cell?
10+
11+
No, XlsIO does not support multiple markers in a single Excel cell. Only one marker is allowed per cell when using template markers.
Lines changed: 87 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,87 @@
1+
---
2+
title: How to get the column width and row height in pixels | Syncfusion
3+
description: Code example showing how to retrieve column width and row height in pixels using the Syncfusion .NET Excel library (XlsIO).
4+
platform: document-processing
5+
control: XlsIO
6+
documentation: UG
7+
---
8+
9+
# How to get the column width and row height in pixels?
10+
11+
In Essential® XlsIO, you can obtain column widths and row heights in pixels by using the [GetColumnWidthInPixels](https://help.syncfusion.com/cr/document-processing/Syncfusion.XlsIO.IWorksheet.html#Syncfusion_XlsIO_IWorksheet_GetColumnWidthInPixels_System_Int32_) and [GetRowHeightInPixels](https://help.syncfusion.com/cr/document-processing/Syncfusion.XlsIO.IWorksheet.html#Syncfusion_XlsIO_IWorksheet_GetRowHeightInPixels_System_Int32_) methods. The below code snippet demonstrates this.
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+
FileStream inputStream = new FileStream("InputTemplate.xlsx", FileMode.Open, FileAccess.Read);
20+
IWorkbook workbook = application.Workbooks.Open(inputStream);
21+
IWorksheet worksheet = workbook.Worksheets[0];
22+
23+
var range = worksheet.UsedRange["A1"];
24+
25+
//Get the Column width in pixels
26+
var width = worksheet.GetColumnWidthInPixels(range.Column);
27+
28+
//Get the Row height in pixels
29+
var height = worksheet.GetRowHeightInPixels(range.Row);
30+
31+
#region Save
32+
//Saving the workbook
33+
FileStream outputStream = new FileStream("RowsandColumns.xlsx", FileMode.Create, FileAccess.Write);
34+
workbook.SaveAs(outputStream);
35+
#endregion
36+
37+
//Dispose streams
38+
outputStream.Dispose();
39+
inputStream.Dispose();
40+
}
41+
{% endhighlight %}
42+
43+
{% highlight c# tabtitle="C# [Windows-specific]" %}
44+
using (ExcelEngine excelEngine = new ExcelEngine())
45+
{
46+
IApplication application = excelEngine.Excel;
47+
application.DefaultVersion = ExcelVersion.Xlsx;
48+
IWorkbook workbook = application.Workbooks.Open("InputTemplate.xlsx");
49+
IWorksheet worksheet = workbook.Worksheets[0];
50+
var range = worksheet.UsedRange["A1"];
51+
52+
//Get the Column width in pixels
53+
var width = worksheet.GetColumnWidthInPixels(range.Column);
54+
55+
//Get the Row height in pixels
56+
var height = worksheet.GetRowHeightInPixels(range.Row);
57+
58+
workbook.SaveAs("RowsandColumns.xlsx");
59+
}
60+
{% endhighlight %}
61+
62+
{% highlight vb.net tabtitle="VB.NET [Windows-specific]" %}
63+
Using excelEngine As ExcelEngine = New ExcelEngine()
64+
Dim application As IApplication = excelEngine.Excel
65+
application.DefaultVersion = ExcelVersion.Excel2013
66+
Dim workbook As IWorkbook = application.Workbooks.Open("InputTemplate.xlsx", ExcelOpenType.Automatic)
67+
Dim worksheet As IWorksheet = workbook.Worksheets(0)
68+
69+
Dim range = worksheet.UsedRange("A1")
70+
' Column width in pixels
71+
Dim width As Integer = worksheet.GetColumnWidthInPixels(range.Column)
72+
' Row height in pixels
73+
Dim height As Integer = worksheet.GetRowHeightInPixels(range.Row)
74+
75+
workbook.SaveAs("GridLineColor.xlsx")
76+
End Using
77+
{% endhighlight %}
78+
{% endtabs %}
79+
80+
## See Also
81+
82+
* [How to format text within a cell?](https://help.syncfusion.com/document-processing/excel/excel-library/net/faqs/how-to-format-text-within-a-cell)
83+
* [How to unfreeze the rows and columns in XlsIO?](https://help.syncfusion.com/document-processing/excel/excel-library/net/faqs/how-to-unfreeze-the-rows-and-columns-in-xlsio)
84+
* [What is the maximum range of Rows and Columns?](https://help.syncfusion.com/document-processing/excel/excel-library/net/faqs/what-is-the-maximum-range-of-rows-and-columns)
85+
* [How to find values with a matching case for specific column in Excel?](https://help.syncfusion.com/document-processing/excel/excel-library/net/faqs/how-to-find-values-with-a-matching-case-for-specific-column-in-excel)
86+
* [How to protect certain cells in a worksheet?](https://help.syncfusion.com/document-processing/excel/excel-library/net/faqs/how-to-protect-certain-cells-in-a-worksheet)
87+
* [How to search a value in only specific columns of an Excel worksheet?](https://help.syncfusion.com/document-processing/excel/excel-library/net/faqs/how-to-search-a-value-in-only-specific-columns-of-an-excel-worksheet)

0 commit comments

Comments
 (0)