Skip to content

Commit a9d5d1c

Browse files
authored
Merge pull request #149 from SyncfusionExamples/922444-Playground-Button
922444- Add Playground Button for Feature tour
2 parents 977465e + 1be49cd commit a9d5d1c

File tree

86 files changed

+11097
-5
lines changed

Some content is hidden

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

86 files changed

+11097
-5
lines changed

CSV to Excel/CSV to Excel/.NET/CSV to Excel/CSV to Excel/Program.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ public static void Main(string[] args)
1717
IWorksheet worksheet = workbook.Worksheets[0];
1818

1919
//Saving the workbook as stream
20-
FileStream outputStream = new FileStream(Path.GetFullPath("Output/Output.xlsx"), FileMode.Create, FileAccess.Write);
20+
FileStream outputStream = new FileStream(Path.GetFullPath("Output/CSV to Excel.xlsx"), FileMode.Create, FileAccess.Write);
2121
workbook.SaveAs(outputStream);
2222

2323
//Dispose streams
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
2+
Microsoft Visual Studio Solution File, Format Version 12.00
3+
# Visual Studio Version 17
4+
VisualStudioVersion = 17.12.35417.141 d17.12
5+
MinimumVisualStudioVersion = 10.0.40219.1
6+
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Custom Validation", "Custom Validation\Custom Validation.csproj", "{9DF53F0C-052E-4760-AF98-06C06305121D}"
7+
EndProject
8+
Global
9+
GlobalSection(SolutionConfigurationPlatforms) = preSolution
10+
Debug|Any CPU = Debug|Any CPU
11+
Release|Any CPU = Release|Any CPU
12+
EndGlobalSection
13+
GlobalSection(ProjectConfigurationPlatforms) = postSolution
14+
{9DF53F0C-052E-4760-AF98-06C06305121D}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
15+
{9DF53F0C-052E-4760-AF98-06C06305121D}.Debug|Any CPU.Build.0 = Debug|Any CPU
16+
{9DF53F0C-052E-4760-AF98-06C06305121D}.Release|Any CPU.ActiveCfg = Release|Any CPU
17+
{9DF53F0C-052E-4760-AF98-06C06305121D}.Release|Any CPU.Build.0 = Release|Any CPU
18+
EndGlobalSection
19+
GlobalSection(SolutionProperties) = preSolution
20+
HideSolutionNode = FALSE
21+
EndGlobalSection
22+
EndGlobal
Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
<Project Sdk="Microsoft.NET.Sdk">
2+
3+
<PropertyGroup>
4+
<OutputType>Exe</OutputType>
5+
<TargetFramework>net8.0</TargetFramework>
6+
<RootNamespace>Custom_Validation</RootNamespace>
7+
<ImplicitUsings>enable</ImplicitUsings>
8+
<Nullable>enable</Nullable>
9+
</PropertyGroup>
10+
11+
<ItemGroup>
12+
<PackageReference Include="Syncfusion.XlsIO.Net.Core" Version="*" />
13+
</ItemGroup>
14+
15+
<ItemGroup>
16+
<None Update="Data\*">
17+
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
18+
</None>
19+
<None Update="Output\*">
20+
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
21+
</None>
22+
</ItemGroup>
23+
</Project>

Data Validation/Custom Validation/.NET/Custom Validation/Custom Validation/Output/.gitkeep

Whitespace-only changes.
Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
using Syncfusion.XlsIO;
2+
3+
namespace Custom_Validation
4+
{
5+
class Program
6+
{
7+
public static void Main(string[] args)
8+
{
9+
// Initialize Excel engine and application.
10+
using (ExcelEngine excelEngine = new ExcelEngine())
11+
{
12+
IApplication application = excelEngine.Excel;
13+
application.DefaultVersion = ExcelVersion.Xlsx;
14+
15+
// Create a workbook and worksheet.
16+
IWorkbook workbook = application.Workbooks.Create(1);
17+
IWorksheet worksheet = workbook.Worksheets[0];
18+
19+
// Data validation for custom data.
20+
IDataValidation validation = worksheet.Range["A3"].DataValidation;
21+
worksheet.Range["A1"].Text = "Enter the value greater than 10 in A1";
22+
worksheet.Range["A2"].Text = "Enter the text in A3";
23+
worksheet.Range["A1"].AutofitColumns();
24+
validation.AllowType = ExcelDataType.Formula;
25+
validation.FirstFormula = "=A1>10";
26+
27+
// Show the error message.
28+
validation.ShowErrorBox = true;
29+
validation.ErrorBoxText = "A1 value is less than 10";
30+
validation.ErrorBoxTitle = "ERROR";
31+
validation.PromptBoxText = "Custom Data Validation";
32+
validation.ShowPromptBox = true;
33+
34+
// Save the Excel document.
35+
FileStream outputStream = new FileStream(Path.GetFullPath("Output/CustomValidation.xlsx"), FileMode.Create, FileAccess.Write);
36+
workbook.SaveAs(outputStream);
37+
38+
//Dispose streams
39+
outputStream.Dispose();
40+
}
41+
}
42+
}
43+
}

Excel to CSV/Excel to CSV/.NET/Excel to CSV/Excel to CSV/Program.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ public static void Main(string[] args)
1414
IWorkbook workbook = application.Workbooks.Open(inputStream);
1515

1616
//Saving the workbook as streams
17-
FileStream outputStream = new FileStream(Path.GetFullPath("Output/Sample.csv"), FileMode.Create, FileAccess.ReadWrite);
17+
FileStream outputStream = new FileStream(Path.GetFullPath("Output/Excel to CSV.csv"), FileMode.Create, FileAccess.ReadWrite);
1818
workbook.SaveAs(outputStream, ",");
1919

2020
//Dispose streams

Excel to TSV/Excel to TSV/.NET/Excel to TSV/Excel to TSV/Program.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ public static void Main(string[] args)
1515
IWorkbook workbook = application.Workbooks.Open(inputStream);
1616

1717
//Save the workbook in CSV format with tab(\t) as delimiter
18-
FileStream outputStream = new FileStream(Path.GetFullPath("Output/Output.tsv"), FileMode.Create, FileAccess.ReadWrite);
18+
FileStream outputStream = new FileStream(Path.GetFullPath("Output/Excel to TSV.tsv"), FileMode.Create, FileAccess.ReadWrite);
1919
workbook.SaveAs(outputStream, "\t");
2020
}
2121
}
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
2+
Microsoft Visual Studio Solution File, Format Version 12.00
3+
# Visual Studio Version 17
4+
VisualStudioVersion = 17.12.35417.141 d17.12
5+
MinimumVisualStudioVersion = 10.0.40219.1
6+
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Excel to Text", "Excel to Text\Excel to Text.csproj", "{6657A512-E336-4097-8D5E-BF4A998D261A}"
7+
EndProject
8+
Global
9+
GlobalSection(SolutionConfigurationPlatforms) = preSolution
10+
Debug|Any CPU = Debug|Any CPU
11+
Release|Any CPU = Release|Any CPU
12+
EndGlobalSection
13+
GlobalSection(ProjectConfigurationPlatforms) = postSolution
14+
{6657A512-E336-4097-8D5E-BF4A998D261A}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
15+
{6657A512-E336-4097-8D5E-BF4A998D261A}.Debug|Any CPU.Build.0 = Debug|Any CPU
16+
{6657A512-E336-4097-8D5E-BF4A998D261A}.Release|Any CPU.ActiveCfg = Release|Any CPU
17+
{6657A512-E336-4097-8D5E-BF4A998D261A}.Release|Any CPU.Build.0 = Release|Any CPU
18+
EndGlobalSection
19+
GlobalSection(SolutionProperties) = preSolution
20+
HideSolutionNode = FALSE
21+
EndGlobalSection
22+
EndGlobal
Binary file not shown.
Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
<Project Sdk="Microsoft.NET.Sdk">
2+
3+
<PropertyGroup>
4+
<OutputType>Exe</OutputType>
5+
<TargetFramework>net8.0</TargetFramework>
6+
<RootNamespace>Excel_to_Text</RootNamespace>
7+
<ImplicitUsings>enable</ImplicitUsings>
8+
<Nullable>enable</Nullable>
9+
</PropertyGroup>
10+
11+
<ItemGroup>
12+
<PackageReference Include="Syncfusion.XlsIO.Net.Core" Version="*" />
13+
</ItemGroup>
14+
15+
<ItemGroup>
16+
<None Update="Data\*">
17+
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
18+
</None>
19+
<None Update="Output\*">
20+
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
21+
</None>
22+
</ItemGroup>
23+
24+
</Project>

0 commit comments

Comments
 (0)