Skip to content

Commit 9533f81

Browse files
committed
Playground Button
1 parent 1cfeba9 commit 9533f81

File tree

35 files changed

+521
-1
lines changed

35 files changed

+521
-1
lines changed
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+
}
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>

Excel to Text/Excel to Text/.NET/Excel to Text/Excel to Text/Output/.gitkeep

Whitespace-only changes.
Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
using Syncfusion.XlsIO;
2+
3+
namespace Excel_to_Text
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+
// Open an existing workbook.
16+
FileStream inputStream = new FileStream(Path.GetFullPath("Data/InputTemplate.xlsx"), FileMode.Open, FileAccess.Read);
17+
IWorkbook workbook = application.Workbooks.Open(inputStream);
18+
19+
// Save the workbook in .txt format with space (" ") as the delimiter.
20+
using FileStream outputStream = new FileStream(Path.GetFullPath("Output/Excel to Text.txt"), FileMode.Create, FileAccess.ReadWrite);
21+
workbook.SaveAs(outputStream, " ");
22+
}
23+
}
24+
}
25+
}
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}") = "Import Array", "Import Array\Import Array.csproj", "{686B45E1-3585-408C-B498-8F90C8379DD5}"
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+
{686B45E1-3585-408C-B498-8F90C8379DD5}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
15+
{686B45E1-3585-408C-B498-8F90C8379DD5}.Debug|Any CPU.Build.0 = Debug|Any CPU
16+
{686B45E1-3585-408C-B498-8F90C8379DD5}.Release|Any CPU.ActiveCfg = Release|Any CPU
17+
{686B45E1-3585-408C-B498-8F90C8379DD5}.Release|Any CPU.Build.0 = Release|Any CPU
18+
EndGlobalSection
19+
GlobalSection(SolutionProperties) = preSolution
20+
HideSolutionNode = FALSE
21+
EndGlobalSection
22+
EndGlobal

0 commit comments

Comments
 (0)