Skip to content

Commit ee0f651

Browse files
Merge pull request #2027 from Syncfusion-Content/hotfix/hotfix-v32.1.19
DOCINFRA-2341_merged_using_automation
2 parents ec8a3cd + c2c4829 commit ee0f651

7 files changed

Lines changed: 250 additions & 47 deletions

File tree

Document-Processing-toc.html

Lines changed: 45 additions & 38 deletions
Original file line numberDiff line numberDiff line change
@@ -2603,44 +2603,45 @@
26032603
</li>
26042604
</ul>
26052605
</li>
2606-
<li>
2607-
<a href="/document-processing/pdf/pdf-library/javascript/Overview">JavaScript</a>
2608-
<ul>
2609-
<li><a href="/document-processing/pdf/pdf-library/javascript/Overview">Overview</a></li>
2610-
<li>Getting Started
2611-
<ul>
2612-
<li><a href="/document-processing/pdf/pdf-library/javascript/Create-PDF-document-asp-net-core">ASP.NET Core</a></li>
2613-
<li><a href="/document-processing/pdf/pdf-library/javascript/Create-PDF-document-asp-net-mvc">ASP.NET MVC</a></li>
2614-
<li><a href="/document-processing/pdf/pdf-library/javascript/Create-PDF-document-angular">Angular</a></li>
2615-
<li><a href="/document-processing/pdf/pdf-library/javascript/Create-PDF-document-react">React</a></li>
2616-
<li><a href="/document-processing/pdf/pdf-library/javascript/Create-PDF-document-vue">Vue</a></li>
2617-
<li><a href="/document-processing/pdf/pdf-library/javascript/Create-PDF-document-javascript">JavaScript</a></li>
2618-
<li><a href="/document-processing/pdf/pdf-library/javascript/Create-PDF-document-typescript">TypeScript</a></li>
2619-
</ul>
2620-
</li>
2621-
<li><a href="/document-processing/pdf/pdf-library/javascript/Open-and-save-PDF-files">Loading and Saving</a></li>
2622-
<li><a href="/document-processing/pdf/pdf-library/javascript/PDF-document">PDF Document</a></li>
2623-
<li><a href="/document-processing/pdf/pdf-library/javascript/PDF-pages">PDF Pages</a></li>
2624-
<li><a href="/document-processing/pdf/pdf-library/javascript/Text">Text</a></li>
2625-
<li><a href="/document-processing/pdf/pdf-library/javascript/Lists">Lists</a></li>
2626-
<li><a href="/document-processing/pdf/pdf-library/javascript/Images">Images</a></li>
2627-
<li><a href="/document-processing/pdf/pdf-library/javascript/Templates">Templates</a></li>
2628-
<li><a href="/document-processing/pdf/pdf-library/javascript/Shapes">Shapes</a></li>
2629-
<li><a href="/document-processing/pdf/pdf-library/javascript/Annotations">Annotations</a></li>
2630-
<li><a href="/document-processing/pdf/pdf-library/javascript/FormFields">Form Fields</a></li>
2631-
<li><a href="/document-processing/pdf/pdf-library/javascript/DigitalSignature">Digital Signature</a></li>
2632-
<li><a href="/document-processing/pdf/pdf-library/javascript/Bookmarks">Bookmarks</a></li>
2633-
<li><a href="/document-processing/pdf/pdf-library/javascript/HyperLinks">Hyperlinks</a></li>
2634-
<li><a href="/document-processing/pdf/pdf-library/javascript/Layers">Layers</a></li>
2635-
<li><a href="/document-processing/pdf/pdf-library/javascript/Watermarks">Watermarks</a></li>
2636-
<li><a href="/document-processing/pdf/pdf-library/javascript/Merge-Document">Merge PDF</a></li>
2637-
<li><a href="/document-processing/pdf/pdf-library/javascript/Split-Documents">Split PDF</a></li>
2638-
<li><a href="/document-processing/pdf/pdf-library/javascript/Text-Extraction">Text Extraction</a></li>
2639-
<li><a href="/document-processing/pdf/pdf-library/javascript/Image-Extraction">Image Extraction</a></li>
2640-
<li><a href="/document-processing/pdf/pdf-library/javascript/Redaction">Redaction</a></li>
2641-
</ul>
2642-
2643-
</li>
2606+
<ul>
2607+
<li>
2608+
<a href="/document-processing/pdf/pdf-library/javascript/Overview">JavaScript</a>
2609+
<ul>
2610+
<li><a href="/document-processing/pdf/pdf-library/javascript/Overview">Overview</a></li>
2611+
<li>Getting Started
2612+
<ul>
2613+
<li><a href="/document-processing/pdf/pdf-library/javascript/Create-PDF-document-asp-net-core">ASP.NET Core</a></li>
2614+
<li><a href="/document-processing/pdf/pdf-library/javascript/Create-PDF-document-asp-net-mvc">ASP.NET MVC</a></li>
2615+
<li><a href="/document-processing/pdf/pdf-library/javascript/Create-PDF-document-angular">Angular</a></li>
2616+
<li><a href="/document-processing/pdf/pdf-library/javascript/Create-PDF-document-react">React</a></li>
2617+
<li><a href="/document-processing/pdf/pdf-library/javascript/Create-PDF-document-vue">Vue</a></li>
2618+
<li><a href="/document-processing/pdf/pdf-library/javascript/Create-PDF-document-javascript">JavaScript</a></li>
2619+
<li><a href="/document-processing/pdf/pdf-library/javascript/Create-PDF-document-typescript">TypeScript</a></li>
2620+
</ul>
2621+
</li>
2622+
<li><a href="/document-processing/pdf/pdf-library/javascript/Open-and-save-PDF-files">Loading and Saving</a></li>
2623+
<li><a href="/document-processing/pdf/pdf-library/javascript/PDF-document">PDF Document</a></li>
2624+
<li><a href="/document-processing/pdf/pdf-library/javascript/PDF-pages">PDF Pages</a></li>
2625+
<li><a href="/document-processing/pdf/pdf-library/javascript/Text">Text</a></li>
2626+
<li><a href="/document-processing/pdf/pdf-library/javascript/Lists">Lists</a></li>
2627+
<li><a href="/document-processing/pdf/pdf-library/javascript/Images">Images</a></li>
2628+
<li><a href="/document-processing/pdf/pdf-library/javascript/Templates">Templates</a></li>
2629+
<li><a href="/document-processing/pdf/pdf-library/javascript/Shapes">Shapes</a></li>
2630+
<li><a href="/document-processing/pdf/pdf-library/javascript/Annotations">Annotations</a></li>
2631+
<li><a href="/document-processing/pdf/pdf-library/javascript/FormFields">Form Fields</a></li>
2632+
<li><a href="/document-processing/pdf/pdf-library/javascript/DigitalSignature">Digital Signature</a></li>
2633+
<li><a href="/document-processing/pdf/pdf-library/javascript/Bookmarks">Bookmarks</a></li>
2634+
<li><a href="/document-processing/pdf/pdf-library/javascript/HyperLinks">Hyperlinks</a></li>
2635+
<li><a href="/document-processing/pdf/pdf-library/javascript/Layers">Layers</a></li>
2636+
<li><a href="/document-processing/pdf/pdf-library/javascript/Watermarks">Watermarks</a></li>
2637+
<li><a href="/document-processing/pdf/pdf-library/javascript/Merge-Document">Merge PDF</a></li>
2638+
<li><a href="/document-processing/pdf/pdf-library/javascript/Split-Documents">Split PDF</a></li>
2639+
<li><a href="/document-processing/pdf/pdf-library/javascript/Text-Extraction">Text Extraction</a></li>
2640+
<li><a href="/document-processing/pdf/pdf-library/javascript/Image-Extraction">Image Extraction</a></li>
2641+
<li><a href="/document-processing/pdf/pdf-library/javascript/Redaction">Redaction</a></li>
2642+
</ul>
2643+
</li>
2644+
</ul>
26442645
<li>
26452646
<a href="/document-processing/pdf/pdf-library/flutter/overview">Flutter</a>
26462647
<ul>
@@ -6130,6 +6131,12 @@
61306131
<li>
61316132
<a href="/document-processing/excel/excel-library/net/faqs/how-to-perform-a-clean-installation-of-a-NuGet-package-from-a-local-source">How to perform a clean installation of a NuGet package from a local source?</a>
61326133
</li>
6134+
<li>
6135+
<a href="/document-processing/excel/excel-library/net/faqs/how-to-get-the-column-color">How to get the column color when column cells have different colors?</a>
6136+
</li>
6137+
<li>
6138+
<a href="/document-processing/excel/excel-library/net/faqs/how-to-preserve-leading-zeros-when-importing-data-to-excel">How to preserve leading zeros when importing DataTable to Excel?</a>
6139+
</li>
61336140
</ul>
61346141
</li>
61356142
</ul>
Lines changed: 58 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,58 @@
1+
---
2+
title: How to get the column color | Syncfusion.
3+
description: This page explains how to get the styled column color when column cells have different colors in an Excel document using Syncfusion .NET Excel library (XlsIO).
4+
platform: document-processing
5+
control: XlsIO
6+
documentation: UG
7+
---
8+
9+
# How to get the column color when column cells have different colors?
10+
11+
According to Microsoft Excel behavior, when a column's cells have different fill colors, the column color property returns an empty value. Syncfusion XlsIO mirrors this behavior, as Excel doesn't set a unified column color in such cases. This can lead to issues when trying to retrieve color using column cell style properties.
12+
The following code example illustrates how to get the column color when column cells have different colors in an Excel document.
13+
14+
{% tabs %}
15+
{% highlight c# tabtitle="C# [Cross-platform]" %}
16+
using (ExcelEngine excelEngine = new ExcelEngine())
17+
{
18+
IApplication application = excelEngine.Excel;
19+
application.DefaultVersion = ExcelVersion.Xlsx;
20+
21+
IWorkbook workbook = application.Workbooks.Open("Column styles.xlsx", ExcelOpenType.Automatic);
22+
23+
IWorksheet worksheet = workbook.Worksheets[0];
24+
25+
ExtendedFormatImpl format = (workbook as WorkbookImpl).InnerExtFormats[(worksheet["A1"] as RangeImpl).ExtendedFormatIndex];
26+
Color color = format.Color;
27+
}
28+
{% endhighlight %}
29+
30+
{% highlight c# tabtitle="C# [Windows-specific]" %}
31+
using (ExcelEngine excelEngine = new ExcelEngine())
32+
{
33+
IApplication application = excelEngine.Excel;
34+
application.DefaultVersion = ExcelVersion.Xlsx;
35+
36+
IWorkbook workbook = application.Workbooks.Open("Column styles.xlsx", ExcelOpenType.Automatic);
37+
38+
IWorksheet worksheet = workbook.Worksheets[0];
39+
40+
ExtendedFormatImpl format = (workbook as WorkbookImpl).InnerExtFormats[(worksheet["A1"] as RangeImpl).ExtendedFormatIndex];
41+
Color color = format.Color;
42+
}
43+
{% endhighlight %}
44+
45+
{% highlight vb.net tabtitle="VB.NET [Windows-specific]" %}
46+
Using excelEngine As New ExcelEngine()
47+
Dim application As IApplication = excelEngine.Excel
48+
application.DefaultVersion = ExcelVersion.Xlsx
49+
50+
Dim workbook As IWorkbook = application.Workbooks.Open("Column styles.xlsx", ExcelOpenType.Automatic)
51+
Dim worksheet As IWorksheet = workbook.Worksheets(0)
52+
53+
Dim format As ExtendedFormatImpl = DirectCast(workbook, WorkbookImpl).InnerExtFormats(DirectCast(worksheet("A1"), RangeImpl).ExtendedFormatIndex)
54+
Dim color As Color = format.Color
55+
56+
End Using
57+
{% endhighlight %}
58+
{% endtabs %}
Lines changed: 134 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,134 @@
1+
---
2+
title: Preserve leading zeros when importing data to Excel | Syncfusion
3+
description: Discover how to keep leading zeros in text when importing a DataTable to Excel using Syncfusion .NET Excel library.
4+
platform: document-processing
5+
control: XlsIO
6+
documentation: UG
7+
---
8+
9+
# How to preserve leading zeros when importing DataTable to Excel?
10+
11+
Excel often treats numeric-looking text as numbers, removing leading zeros. The same behavior is followed when importing DataTable to Excel by the Syncfusion .NET Excel (XlsIO) library. The leading zeros can be preserved by providing the parameter "PreserveDataTypes" in the ImportDataTable method as "True" when importing the data.
12+
13+
The following code snippet shows how to use the PreserveDataTypes option in XlsIO.
14+
15+
{% tabs %}
16+
{% highlight c# tabtitle="C# [Cross-platform]" %}
17+
18+
using (ExcelEngine excelEngine = new ExcelEngine())
19+
{
20+
IApplication application = excelEngine.Excel;
21+
application.DefaultVersion = ExcelVersion.Xlsx;
22+
IWorkbook workbook = application.Workbooks.Create(1);
23+
IWorksheet worksheet = workbook.Worksheets[0];
24+
25+
#region Import from Data Table
26+
//Initialize the DataTable
27+
DataTable table = SampleDataTable();
28+
//Set the final parameter (preserveTypes) to true to preserve the data types.
29+
worksheet.ImportDataTable(table, true, 1, 1, true);
30+
#endregion
31+
32+
#region Save
33+
//Saving the workbook
34+
workbook.SaveAs(Path.GetFullPath("Output/ImportDataTable.xlsx"));
35+
#endregion
36+
}
37+
static DataTable SampleDataTable()
38+
{
39+
//Create a DataTable with four columns
40+
DataTable table = new DataTable();
41+
table.Columns.Add("Dosage", typeof(int));
42+
table.Columns.Add("Drug", typeof(string));
43+
table.Columns.Add("Patient", typeof(string));
44+
table.Columns.Add("Date", typeof(DateTime));
45+
46+
//Add five DataRows
47+
table.Rows.Add(25, "032132", "David", DateTime.Now);
48+
table.Rows.Add(50, "Enebrel", "Sam", DateTime.Now);
49+
table.Rows.Add(10, "Hydralazine", "Christoff", DateTime.Now);
50+
table.Rows.Add(21, "Combivent", "Janet", DateTime.Now);
51+
table.Rows.Add(100, "Dilantin", "Melanie", DateTime.Now);
52+
53+
return table;
54+
}
55+
56+
{% endhighlight %}
57+
58+
{% highlight c# tabtitle="C# [Windows-specific]" %}
59+
60+
using (ExcelEngine excelEngine = new ExcelEngine())
61+
{
62+
IApplication application = excelEngine.Excel;
63+
application.DefaultVersion = ExcelVersion.Excel2016;
64+
IWorkbook workbook = application.Workbooks.Create(1);
65+
IWorksheet worksheet = workbook.Worksheets[0];
66+
67+
//Initialize the DataTable
68+
DataTable table = SampleDataTable();
69+
70+
//Set the final parameter (preserveTypes) to true to preserve the data types.
71+
worksheet.ImportDataTable(table, true, 1, 1, true);
72+
73+
workbook.SaveAs("ImportFromDT.xlsx");
74+
}
75+
private static DataTable SampleDataTable()
76+
{
77+
//Create a DataTable with four columns
78+
DataTable table = new DataTable();
79+
table.Columns.Add("Dosage", typeof(int));
80+
table.Columns.Add("Drug", typeof(string));
81+
table.Columns.Add("Patient", typeof(string));
82+
table.Columns.Add("Date", typeof(DateTime));
83+
84+
//Add five DataRows
85+
table.Rows.Add(25, "032132", "David", DateTime.Now);
86+
table.Rows.Add(50, "Enebrel", "Sam", DateTime.Now);
87+
table.Rows.Add(10, "Hydralazine", "Christoff", DateTime.Now);
88+
table.Rows.Add(21, "Combivent", "Janet", DateTime.Now);
89+
table.Rows.Add(100, "Dilantin", "Melanie", DateTime.Now);
90+
91+
return table;
92+
}
93+
94+
{% endhighlight %}
95+
96+
{% highlight vb.net tabtitle="VB.NET [Windows-specific]" %}
97+
98+
Using excelEngine As ExcelEngine = New ExcelEngine()
99+
Dim application As IApplication = excelEngine.Excel
100+
application.DefaultVersion = ExcelVersion.Excel2016
101+
Dim workbook As IWorkbook = application.Workbooks.Create(1)
102+
Dim worksheet As IWorksheet = workbook.Worksheets(0)
103+
104+
'Initialize the DataTable
105+
Dim table As DataTable = sampleDataTable()
106+
'Set the final parameter (preserveTypes) to true to preserve the data types.
107+
worksheet.ImportDataTable(table, True, 1, 1, True)
108+
109+
workbook.SaveAs("ImportFromDT.xlsx")
110+
End Using
111+
Private Function SampleDataTable() As DataTable
112+
' Create a DataTable with four columns
113+
Dim table As New DataTable()
114+
table.Columns.Add("Dosage", GetType(Integer))
115+
table.Columns.Add("Drug", GetType(String))
116+
table.Columns.Add("Patient", GetType(String))
117+
table.Columns.Add("Date", GetType(Date))
118+
119+
' Add five DataRows
120+
table.Rows.Add(25, "032132", "David", DateTime.Now)
121+
table.Rows.Add(50, "Enebrel", "Sam", DateTime.Now)
122+
table.Rows.Add(10, "Hydralazine", "Christoff", DateTime.Now)
123+
table.Rows.Add(21, "Combivent", "Janet", DateTime.Now)
124+
table.Rows.Add(100, "Dilantin", "Melanie", DateTime.Now)
125+
Return table
126+
End Function
127+
128+
{% endhighlight %}
129+
{% endtabs %}
130+
131+
## See Also
132+
133+
* [How to import data table with its data type using template markers?](https://help.syncfusion.com/document-processing/excel/excel-library/net/faqs/how-to-import-data-table-with-its-data-type-using-template-markers)
134+
* [Import to Excel Document](https://help.syncfusion.com/document-processing/excel/excel-library/net/import-export/import-to-excel)

Document-Processing/PDF/PDF-Library/javascript/Create-PDF-document-javascript.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ Step 2: The JS 2 global scripts and styles are hosted on the CDN in the followin
2727
Step 3: Create a HTML page (index.html) in `my-app` location and add the CDN link references.
2828

2929
{% tabs %}
30-
{% highlight html tabtitle="index.html" %}
30+
{% highlight javascript tabtitle="index.html" %}
3131
<head>
3232
<!-- Syncfusion JavaScript PDF Library (CDN) -->
3333
<script src="https://cdn.syncfusion.com/ej2/31.2.15/dist/ej2.min.js"></script>
@@ -43,7 +43,7 @@ Ensure your server serves .wasm files with the Content-Type: application/wasm MI
4343
Step 4: **Create a PDF document**: Add the script in `index.html` by creating a button and attaching a click event that uses the JavaScript PDF API to generate a PDF document.
4444

4545
{% tabs %}
46-
{% highlight html tabtitle="~/Index.html" %}
46+
{% highlight javascript tabtitle="index.html" %}
4747
<div class="container py-4">
4848
<h1 class="h4 mb-3">Create PDF document</h1>
4949
<p class="text-muted">Click the button to generate and download a PDF.</p>
@@ -55,7 +55,7 @@ Step 4: **Create a PDF document**: Add the script in `index.html` by creating a
5555
// Create a new PDF document
5656
var pdf = new ej.pdf.PdfDocument();
5757
// Add a new page
58-
var page = document.addPage();
58+
var page = pdf.addPage();
5959
// Get graphics from the page
6060
var graphics = page.graphics;
6161
// Set font

Document-Processing/PDF/PDF-Library/javascript/Create-PDF-document-typescript.md

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ Ensure your server serves .wasm files with the Content-Type: application/wasm MI
3232

3333
The following list of dependencies are required to use the `TypeScript PDF library` component in your application.
3434

35-
```text
35+
```bash
3636
|-- @syncfusion/ej2-compression
3737
|-- @syncfusion/ej2-base
3838
```
@@ -57,15 +57,18 @@ The following list of dependencies are required to use the `TypeScript PDF libra
5757
* Include the following namespaces in `index.ts` file.
5858

5959
{% tabs %}
60-
{% highlight ts tabtitle="index.ts" %}
60+
{% highlight typescript tabtitle="index.ts" %}
61+
6162
import { PdfDocument, PdfGraphics, PdfPage, PdfFont, PdfFontFamily, PdfFontStyle, PdfBrush } from '@syncfusion/ej2-pdf';
63+
6264
{% endhighlight %}
6365
{% endtabs %}
6466

6567
* Include the following code example in the click event of the button in `index.ts` to generate a PDF document
6668

6769
{% tabs %}
68-
{% highlight ts tabtitle="index.ts" %}
70+
{% highlight typescript tabtitle="index.ts" %}
71+
6972
document.getElementById('normalButton').onclick = (): void => {
7073
// Create a new PDF document
7174
let pdf = new PdfDocument();
@@ -84,14 +87,15 @@ document.getElementById('normalButton').onclick = (): void => {
8487
// Destroy the PDF document instance
8588
pdf.destroy();
8689
};
90+
8791
{% endhighlight %}
8892
{% endtabs %}
8993

9094
* **Run the application**
9195

9296
The quickstart project is configured to compile and run in the browser. Use the following command to start the application:
9397

94-
````bash
98+
```bash
9599
npm start
96100
```
97101

-15.6 KB
Loading

Document-Processing/PDF/PDF-Library/javascript/Overview.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ The following are the key features of this library.
3939
* [ASP.NET Core](https://help.syncfusion.com/document-processing/pdf/pdf-library/javascript/create-pdf-document-asp-net-core)
4040
* [ASP.NET MVC](https://help.syncfusion.com/document-processing/pdf/pdf-library/javascript/create-pdf-document-asp-net-mvc)
4141
* [Angular](https://help.syncfusion.com/document-processing/pdf/pdf-library/javascript/create-pdf-document-angular)
42-
* React
43-
* Vue
42+
* [React](https://help.syncfusion.com/document-processing/pdf/pdf-library/javascript/create-pdf-document-react)
43+
* [Vue](https://help.syncfusion.com/document-processing/pdf/pdf-library/javascript/create-pdf-document-vue)
4444
* [JavaScript](https://help.syncfusion.com/document-processing/pdf/pdf-library/javascript/create-pdf-document-javascript)
4545
* [TypeScript](https://help.syncfusion.com/document-processing/pdf/pdf-library/javascript/create-pdf-document-typescript)

0 commit comments

Comments
 (0)