Skip to content

Commit 144716c

Browse files
authored
Merge pull request #153 from SyncfusionExamples/924528-Add-Readme-Files
924528-Add-Readme-Files
2 parents f63f187 + 1795d11 commit 144716c

File tree

125 files changed

+6927
-0
lines changed
  • Conditional Formatting
    • Above and Below Average/.NET/Above and Below Average
    • Above and Below Standard Deviation/.NET/Above and Below Standard Deviation
    • Conditional Format with R1C1/.NET/Conditional Format with R1C1
    • Create Conditional Format/.NET/Create Conditional Format
    • Read Conditional Format/.NET/Read Conditional Format
    • Remove Conditional Format/.NET
    • Remove all Conditional Formats/.NET/Remove all Conditional Formats
    • Remove at Index/.NET/Remove at Index
    • Top To Bottom Percent/.NET/Top To Bottom Percent
    • Top to Bottom Rank/.NET/Top to Bottom Rank
    • Unique and Duplicate/.NET/Unique and Duplicate
  • Create and Edit Formulas
    • Argument Separator/.NET/Argument Separator
    • Calculated Column/.NET/Calculated Column
    • Calculated Value/.NET/Calculated Value
    • Calculation Modes/.NET/Calculation Modes
    • Cross Sheet Formula/.NET/Cross Sheet Formula
    • Delete Named Range/.NET/Delete Named Range
    • External Formula/.NET/External Formula
    • Formula Array/.NET/Formula Array
    • Ignore Error/.NET/Ignore Error
    • Incremental Formula/.NET/Incremental Formula
    • Iteration/.NET/Iteration
    • Named Range/.NET/Named Range
    • Set Formula/.NET/Set Formula
    • Types of Calculated Value/.NET/Types of Calculated Value
  • Editing Excel cell-styles
  • Editing Excel cells
    • Access Cell or Range/.NET/Access Cell or Range
    • Access Discontinuous Range/.NET/Access Discontinuous Range
    • Access Migrant Range/.NET/Access Migrant Range
    • Access Relative Range/.NET/Access Relative Range
    • Access Used Range/.NET/Access Used Range
    • Accessing Filter/.NET/Accessing Filter
    • Advanced Filter/.NET/Advanced Filter
    • Cell Color Filter/.NET/Cell Color Filter
    • Clear Content/.NET/Clear Content
    • Combination Filter/.NET/Combination Filter
    • Custom Filter/.NET/Custom Filter
    • Dynamic Filter/.NET/Dynamic Filter
    • Filter/.NET/Filter
    • Find/.NET/Find
    • Font Color Filter/.NET/Font Color Filter
    • Icon Filter/.NET/Icon Filter
    • Precedent and Dependent Cells/.NET/Precedent and Dependent Cells
    • Replace/.NET/Replace
    • Sort On Cell Color/.NET/Sort On Cell Color
    • Sort On Cell Values/.NET/Sort On Cell Values
    • Sort on Font Color/.NET/Sort on Font Color
  • Format rows and columns
    • Autofit Rows and Columns/.NET/Autofit Rows and Columns
    • Delete Rows and Columns/.NET/Delete Rows and Columns
    • Expand or Collapse Groups/.NET/Expand or Collapse Groups
    • Group Rows and Columns/.NET/Group Rows and Columns
    • Hide Range/.NET/Hide Range
    • Hide Rows and Columns/.NET/Hide Rows and Columns
    • Insert Rows and Columns/.NET/Insert Rows and Columns
    • Move Rows and Columns/.NET/Move Rows and Columns
    • Resize Rows and Columns/.NET/Resize Rows and Columns
    • Ungroup Rows and Columns/.NET/Ungroup Rows and Columns
  • Import and Export Data
    • Array to Worksheet/.NET/Array to Worksheet
    • CollectionObjects to Worksheet/.NET/CollectionObjects to Worksheet
    • DataColumn to Worksheet/.NET/DataColumn to Worksheet
    • DataGridView to Worksheet/NET Framework/DataGridView to Worksheet
    • DataTable to Worksheet/.NET/DataTable to Worksheet
    • DataView to Worksheet/.NET/DataView to Worksheet
    • Grouping Options/.NET/Grouping Options
    • HTML Table to Worksheet/.NET/HTML Table to Worksheet
    • Import Data Options/.NET/Import Data Options
    • Layout Options/.NET/Layout Options
    • Worksheet to CollectionObjects/.NET/Worksheet to CollectionObjects
    • Worksheet to DataTable/.NET/Worksheet to DataTable
    • Worksheet to Nested Class/.NET/Worksheet to Nested Class
  • Worksheet Features

Some content is hidden

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

125 files changed

+6927
-0
lines changed
Lines changed: 54 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,54 @@
1+
# How to apply conditional formatting for above or below average values?
2+
3+
Step 1: Create a new C# Console Application project.
4+
5+
Step 2: Name the project.
6+
7+
Step 3: Install the [Syncfusion.XlsIO.Net.Core](https://www.nuget.org/packages/Syncfusion.XlsIO.Net.Core) NuGet package as reference to your .NET Standard applications from [NuGet.org](https://www.nuget.org).
8+
9+
Step 4: Include the following namespaces in the **Program.cs** file.
10+
{% tabs %}
11+
{% highlight c# tabtitle="C#" %}
12+
using System.IO;
13+
using Syncfusion.XlsIO;
14+
{% endhighlight %}
15+
{% endtabs %}
16+
17+
Step 5: Include the below code snippet in **Program.cs** to apply conditional formatting for values below average.
18+
{% tabs %}
19+
{% highlight c# tabtitle="C#" %}
20+
using (ExcelEngine excelEngine = new ExcelEngine())
21+
{
22+
IApplication application = excelEngine.Excel;
23+
application.DefaultVersion = ExcelVersion.Xlsx;
24+
FileStream inputStream = new FileStream(Path.GetFullPath(@"Data/InputTemplate.xlsx"), FileMode.Open, FileAccess.Read);
25+
IWorkbook workbook = application.Workbooks.Open(inputStream);
26+
IWorksheet worksheet = workbook.Worksheets[0];
27+
28+
//Applying conditional formatting to "M6:M35"
29+
IConditionalFormats formats = worksheet.Range["M6:M35"].ConditionalFormats;
30+
IConditionalFormat format = formats.AddCondition();
31+
32+
//Applying above or below average rule in the conditional formatting
33+
format.FormatType = ExcelCFType.AboveBelowAverage;
34+
IAboveBelowAverage aboveBelowAverage = format.AboveBelowAverage;
35+
36+
//Set AverageType as Below for AboveBelowAverage rule.
37+
aboveBelowAverage.AverageType = ExcelCFAverageType.Below;
38+
39+
//Set color for Conditional Formattting.
40+
format.FontColorRGB = Syncfusion.Drawing.Color.FromArgb(255, 255, 255);
41+
format.BackColorRGB = Syncfusion.Drawing.Color.FromArgb(166, 59, 38);
42+
43+
#region Save
44+
//Saving the workbook
45+
FileStream outputStream = new FileStream(Path.GetFullPath("Output/AboveAndBelowAverage.xlsx"), FileMode.Create, FileAccess.Write);
46+
workbook.SaveAs(outputStream);
47+
#endregion
48+
49+
//Dispose streams
50+
outputStream.Dispose();
51+
inputStream.Dispose();
52+
}
53+
{% endhighlight %}
54+
{% endtabs %}
Lines changed: 57 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,57 @@
1+
# How to apply conditional formatting for values above or below the standard deviation?
2+
3+
Step 1: Create a new C# Console Application project.
4+
5+
Step 2: Name the project.
6+
7+
Step 3: Install the [Syncfusion.XlsIO.Net.Core](https://www.nuget.org/packages/Syncfusion.XlsIO.Net.Core) NuGet package as reference to your .NET Standard applications from [NuGet.org](https://www.nuget.org).
8+
9+
Step 4: Include the following namespaces in the **Program.cs** file.
10+
{% tabs %}
11+
{% highlight c# tabtitle="C#" %}
12+
using System.IO;
13+
using Syncfusion.XlsIO;
14+
{% endhighlight %}
15+
{% endtabs %}
16+
17+
Step 5: Include the below code snippet in **Program.cs** to apply conditional formatting for values above the standard deviation.
18+
{% tabs %}
19+
{% highlight c# tabtitle="C#" %}
20+
using (ExcelEngine excelEngine = new ExcelEngine())
21+
{
22+
IApplication application = excelEngine.Excel;
23+
application.DefaultVersion = ExcelVersion.Xlsx;
24+
FileStream inputStream = new FileStream(Path.GetFullPath(@"Data/InputTemplate.xlsx"), FileMode.Open, FileAccess.Read);
25+
IWorkbook workbook = application.Workbooks.Open(inputStream);
26+
IWorksheet worksheet = workbook.Worksheets[0];
27+
28+
//Applying conditional formatting to "M6:M35"
29+
IConditionalFormats formats = worksheet.Range["M6:M35"].ConditionalFormats;
30+
IConditionalFormat format = formats.AddCondition();
31+
32+
//Applying above or below average rule in the conditional formatting
33+
format.FormatType = ExcelCFType.AboveBelowAverage;
34+
IAboveBelowAverage aboveBelowAverage = format.AboveBelowAverage;
35+
36+
//Set AverageType as AboveStdDev for AboveBelowAverage rule.
37+
aboveBelowAverage.AverageType = ExcelCFAverageType.AboveStdDev;
38+
39+
//Set value to StdDevValue property for AboveBelowAverage rule.
40+
aboveBelowAverage.StdDevValue = 1;
41+
42+
//Set color for Conditional Formattting.
43+
format.FontColorRGB = Syncfusion.Drawing.Color.FromArgb(255, 255, 255);
44+
format.BackColorRGB = Syncfusion.Drawing.Color.FromArgb(166, 59, 38);
45+
46+
#region Save
47+
//Saving the workbook
48+
FileStream outputStream = new FileStream(Path.GetFullPath("Output/AboveAndBelowStandardDeviation.xlsx"), FileMode.Create, FileAccess.Write);
49+
workbook.SaveAs(outputStream);
50+
#endregion
51+
52+
//Dispose streams
53+
outputStream.Dispose();
54+
inputStream.Dispose();
55+
}
56+
{% endhighlight %}
57+
{% endtabs %}
Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
# How to apply conditional formatting with formulas in the worksheet?
2+
3+
Step 1: Create a new C# Console Application project.
4+
5+
Step 2: Name the project.
6+
7+
Step 3: Install the [Syncfusion.XlsIO.Net.Core](https://www.nuget.org/packages/Syncfusion.XlsIO.Net.Core) NuGet package as reference to your .NET Standard applications from [NuGet.org](https://www.nuget.org).
8+
9+
Step 4: Include the following namespaces in the **Program.cs** file.
10+
{% tabs %}
11+
{% highlight c# tabtitle="C#" %}
12+
using System.IO;
13+
using Syncfusion.XlsIO;
14+
{% endhighlight %}
15+
{% endtabs %}
16+
17+
Step 5: Include the below code snippet in **Program.cs** to apply conditional formatting with formulas in the worksheet.
18+
{% tabs %}
19+
{% highlight c# tabtitle="C#" %}
20+
using (ExcelEngine excelEngine = new ExcelEngine())
21+
{
22+
IApplication application = excelEngine.Excel;
23+
application.DefaultVersion = ExcelVersion.Xlsx;
24+
IWorkbook workbook = application.Workbooks.Create(1);
25+
IWorksheet worksheet = workbook.Worksheets[0];
26+
27+
//Using FormulaR1C1 property in Conditional Formatting
28+
IConditionalFormats condition = worksheet.Range["E5:E18"].ConditionalFormats;
29+
IConditionalFormat condition1 = condition.AddCondition();
30+
condition1.FirstFormulaR1C1 = "=R[1]C[0]";
31+
condition1.SecondFormulaR1C1 = "=R[1]C[1]";
32+
33+
#region Save
34+
//Saving the workbook
35+
FileStream outputStream = new FileStream(Path.GetFullPath("Output/ConditionalFormat.xlsx"), FileMode.Create, FileAccess.Write);
36+
workbook.SaveAs(outputStream);
37+
#endregion
38+
39+
//Dispose streams
40+
outputStream.Dispose();
41+
}
42+
{% endhighlight %}
43+
{% endtabs %}
Lines changed: 80 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,80 @@
1+
# How to apply conditional formatting in the worksheet?
2+
3+
Step 1: Create a new C# Console Application project.
4+
5+
Step 2: Name the project.
6+
7+
Step 3: Install the [Syncfusion.XlsIO.Net.Core](https://www.nuget.org/packages/Syncfusion.XlsIO.Net.Core) NuGet package as reference to your .NET Standard applications from [NuGet.org](https://www.nuget.org).
8+
9+
Step 4: Include the following namespaces in the **Program.cs** file.
10+
{% tabs %}
11+
{% highlight c# tabtitle="C#" %}
12+
using System.IO;
13+
using Syncfusion.XlsIO;
14+
{% endhighlight %}
15+
{% endtabs %}
16+
17+
Step 5: Include the below code snippet in **Program.cs** to apply conditional formatting in the worksheet.
18+
{% tabs %}
19+
{% highlight c# tabtitle="C#" %}
20+
using (ExcelEngine excelEngine = new ExcelEngine())
21+
{
22+
IApplication application = excelEngine.Excel;
23+
application.DefaultVersion = ExcelVersion.Xlsx;
24+
IWorkbook workbook = application.Workbooks.Create(1);
25+
IWorksheet worksheet = workbook.Worksheets[0];
26+
27+
//Applying conditional formatting to "A1"
28+
IConditionalFormats condition = worksheet.Range["A1"].ConditionalFormats;
29+
IConditionalFormat condition1 = condition.AddCondition();
30+
31+
//Represents conditional format rule that the value in target range should be between 10 and 20
32+
condition1.FormatType = ExcelCFType.CellValue;
33+
condition1.Operator = ExcelComparisonOperator.Between;
34+
condition1.FirstFormula = "10";
35+
condition1.SecondFormula = "20";
36+
worksheet.Range["A1"].Text = "Enter a number between 10 and 20";
37+
38+
//Setting back color and font style to be applied for target range
39+
condition1.BackColor = ExcelKnownColors.Light_orange;
40+
condition1.IsBold = true;
41+
condition1.IsItalic = true;
42+
43+
//Applying conditional formatting to "A3"
44+
condition = worksheet.Range["A3"].ConditionalFormats;
45+
IConditionalFormat condition2 = condition.AddCondition();
46+
47+
//Represents conditional format rule that the cell value should be 1000
48+
condition2.FormatType = ExcelCFType.CellValue;
49+
condition2.Operator = ExcelComparisonOperator.Equal;
50+
condition2.FirstFormula = "1000";
51+
worksheet.Range["A3"].Text = "Enter the Number as 1000";
52+
53+
//Setting fill pattern and back color to target range
54+
condition2.FillPattern = ExcelPattern.LightUpwardDiagonal;
55+
condition2.BackColor = ExcelKnownColors.Yellow;
56+
57+
//Applying conditional formatting to "A5"
58+
condition = worksheet.Range["A5"].ConditionalFormats;
59+
IConditionalFormat condition3 = condition.AddCondition();
60+
61+
//Setting conditional format rule that the cell value for target range should be less than or equal to 1000
62+
condition3.FormatType = ExcelCFType.CellValue;
63+
condition3.Operator = ExcelComparisonOperator.LessOrEqual;
64+
condition3.FirstFormula = "1000";
65+
worksheet.Range["A5"].Text = "Enter a Number which is less than or equal to 1000";
66+
67+
//Setting back color to target range
68+
condition3.BackColor = ExcelKnownColors.Light_green;
69+
70+
#region Save
71+
//Saving the workbook
72+
FileStream outputStream = new FileStream(Path.GetFullPath("Output/ConditionalFormat.xlsx"), FileMode.Create, FileAccess.Write);
73+
workbook.SaveAs(outputStream);
74+
#endregion
75+
76+
//Dispose streams
77+
outputStream.Dispose();
78+
}
79+
{% endhighlight %}
80+
{% endtabs %}
Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
# How to read an existing conditional formatting from the worksheet?
2+
3+
Step 1: Create a new C# Console Application project.
4+
5+
Step 2: Name the project.
6+
7+
Step 3: Install the [Syncfusion.XlsIO.Net.Core](https://www.nuget.org/packages/Syncfusion.XlsIO.Net.Core) NuGet package as reference to your .NET Standard applications from [NuGet.org](https://www.nuget.org).
8+
9+
Step 4: Include the following namespaces in the **Program.cs** file.
10+
{% tabs %}
11+
{% highlight c# tabtitle="C#" %}
12+
using System.IO;
13+
using Syncfusion.XlsIO;
14+
{% endhighlight %}
15+
{% endtabs %}
16+
17+
Step 5: Include the below code snippet in **Program.cs** to read an existing conditional formatting from the worksheet.
18+
{% tabs %}
19+
{% highlight c# tabtitle="C#" %}
20+
using (ExcelEngine excelEngine = new ExcelEngine())
21+
{
22+
IApplication application = excelEngine.Excel;
23+
application.DefaultVersion = ExcelVersion.Xlsx;
24+
FileStream inputStream = new FileStream(Path.GetFullPath(@"Data/InputTemplate.xlsx"), FileMode.Open, FileAccess.Read);
25+
IWorkbook workbook = application.Workbooks.Open(inputStream, ExcelOpenType.Automatic);
26+
IWorksheet worksheet = workbook.Worksheets[0];
27+
28+
//Read conditional formatting settings
29+
string formatType = worksheet.Range["A1"].ConditionalFormats[0].FormatType.ToString();
30+
string cfOperator = worksheet.Range["A1"].ConditionalFormats[0].Operator.ToString();
31+
32+
//Dispose streams
33+
inputStream.Dispose();
34+
}
35+
{% endhighlight %}
36+
{% endtabs %}
Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
# How to remove an existing conditional formatting from the worksheet?
2+
3+
Step 1: Create a new C# Console Application project.
4+
5+
Step 2: Name the project.
6+
7+
Step 3: Install the [Syncfusion.XlsIO.Net.Core](https://www.nuget.org/packages/Syncfusion.XlsIO.Net.Core) NuGet package as reference to your .NET Standard applications from [NuGet.org](https://www.nuget.org).
8+
9+
Step 4: Include the following namespaces in the **Program.cs** file.
10+
{% tabs %}
11+
{% highlight c# tabtitle="C#" %}
12+
using System.IO;
13+
using Syncfusion.XlsIO;
14+
{% endhighlight %}
15+
{% endtabs %}
16+
17+
Step 5: Include the below code snippet in **Program.cs** to remove an existing conditional formatting from the specified range in the worksheet.
18+
{% tabs %}
19+
{% highlight c# tabtitle="C#" %}
20+
using (ExcelEngine excelEngine = new ExcelEngine())
21+
{
22+
IApplication application = excelEngine.Excel;
23+
application.DefaultVersion = ExcelVersion.Xlsx;
24+
25+
FileStream inputStream = new FileStream(Path.GetFullPath(@"Data/InputTemplate.xlsx"), FileMode.Open, FileAccess.Read);
26+
IWorkbook workbook = application.Workbooks.Open(inputStream, ExcelOpenType.Automatic);
27+
IWorksheet worksheet = workbook.Worksheets[0];
28+
29+
//Removing conditional format for a specified range
30+
worksheet.Range["E5"].ConditionalFormats.Remove();
31+
32+
#region Save
33+
//Saving the workbook
34+
FileStream outputStream = new FileStream(Path.GetFullPath("Output/RemoveConditionalFormat.xlsx"), FileMode.Create, FileAccess.Write);
35+
workbook.SaveAs(outputStream);
36+
#endregion
37+
38+
//Dispose streams
39+
outputStream.Dispose();
40+
inputStream.Dispose();
41+
}
42+
{% endhighlight %}
43+
{% endtabs %}
Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
# How to remove conditional formatting from the entire worksheet?
2+
3+
Step 1: Create a new C# Console Application project.
4+
5+
Step 2: Name the project.
6+
7+
Step 3: Install the [Syncfusion.XlsIO.Net.Core](https://www.nuget.org/packages/Syncfusion.XlsIO.Net.Core) NuGet package as reference to your .NET Standard applications from [NuGet.org](https://www.nuget.org).
8+
9+
Step 4: Include the following namespaces in the **Program.cs** file.
10+
{% tabs %}
11+
{% highlight c# tabtitle="C#" %}
12+
using System.IO;
13+
using Syncfusion.XlsIO;
14+
{% endhighlight %}
15+
{% endtabs %}
16+
17+
Step 5: Include the below code snippet in **Program.cs** to remove conditional formatting from the entire worksheet.
18+
{% tabs %}
19+
{% highlight c# tabtitle="C#" %}
20+
using (ExcelEngine excelEngine = new ExcelEngine())
21+
{
22+
IApplication application = excelEngine.Excel;
23+
application.DefaultVersion = ExcelVersion.Xlsx;
24+
FileStream inputStream = new FileStream(Path.GetFullPath(@"Data/InputTemplate.xlsx"), FileMode.Open, FileAccess.Read);
25+
IWorkbook workbook = application.Workbooks.Open(inputStream, ExcelOpenType.Automatic);
26+
IWorksheet worksheet = workbook.Worksheets[0];
27+
28+
//Removing Conditional Formatting Settings From Entire Sheet
29+
worksheet.UsedRange.Clear(ExcelClearOptions.ClearConditionalFormats);
30+
31+
#region Save
32+
//Saving the workbook
33+
FileStream outputStream = new FileStream(Path.GetFullPath("Output/RemoveAll.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+
{% endtabs %}

0 commit comments

Comments
 (0)