Skip to content

Commit

Permalink
Merge pull request #21 from doxa-labs/june-2024
Browse files Browse the repository at this point in the history
New functions & Fix Close & .NET 8 Demo
  • Loading branch information
fatihyildizhan authored Jun 11, 2024
2 parents 5fbf783 + 14275cc commit 9a493bd
Show file tree
Hide file tree
Showing 16 changed files with 529 additions and 142 deletions.
3 changes: 0 additions & 3 deletions Excel.Labs.Demo/Excel.Labs.Demo.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -34,9 +34,6 @@
<WarningLevel>4</WarningLevel>
</PropertyGroup>
<ItemGroup>
<Reference Include="DocumentFormat.OpenXml, Version=2.9.1.0, Culture=neutral, PublicKeyToken=8fb06cb64d019a17, processorArchitecture=MSIL">
<HintPath>..\packages\DocumentFormat.OpenXml.2.9.1\lib\net46\DocumentFormat.OpenXml.dll</HintPath>
</Reference>
<Reference Include="System" />
<Reference Include="System.Core" />
<Reference Include="System.IO.FileSystem.Primitives, Version=4.0.2.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
Expand Down
25 changes: 24 additions & 1 deletion Excel.Labs.Demo/Program.cs
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
using System;
using System.Collections.Generic;
using System.IO;

// team
using Doxa.Labs.Excel.Models;

Expand All @@ -17,6 +19,11 @@ static void Main(string[] args)
// TODO: fullpath: C:\Users\...\ExcelLabs\Excel.Labs.Demo\bin\Debug\Files
string path = AppDomain.CurrentDomain.BaseDirectory + @"Files\";

if (!Directory.Exists(path))
{
Directory.CreateDirectory(path);
}

// 1. create a cell list
List<Cellx> cells = new List<Cellx>();

Expand All @@ -35,7 +42,8 @@ static void Main(string[] args)
"", // K
"Objective-C", // L
"C++", // M
"F#" // N
"F#", // N
"2024 June" // O
};

foreach (string lang in languages)
Expand All @@ -58,6 +66,21 @@ static void Main(string[] args)
// call save function
ExcelLabs.SaveFile(title, path, sheetName, cells);

// call safe save function
ExcelLabs.SaveFileWithCleanXmlText(title, path, sheetName, cells);

// clean not-allowed XML characters
string safeToWriteText = ExcelLabs.CleanTextForXml(title + " safe");
Console.WriteLine("Safe text: " + safeToWriteText);

// convert integer to Excel Column Letter like 1 to A
string excelColumnLetter1 = ExcelLabs.ColumnIndexToColumnLetter(1);
Console.WriteLine("1 to column letter: " + excelColumnLetter1); // A

// convert integer to Excel Column Letter like 1 to G
string excelColumnLetter7 = ExcelLabs.ColumnIndexToColumnLetter(7);
Console.WriteLine("7 to column letter: " + excelColumnLetter7); // G

Console.WriteLine("Done. Check the path now to see the Excel file.");
Console.ReadLine();
}
Expand Down
1 change: 0 additions & 1 deletion Excel.Labs.Demo/packages.config
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
<packages>
<package id="DocumentFormat.OpenXml" version="2.9.1" targetFramework="net472" />
<package id="System.IO.FileSystem.Primitives" version="4.3.0" targetFramework="net472" />
<package id="System.IO.Packaging" version="4.5.0" targetFramework="net472" />
</packages>
42 changes: 21 additions & 21 deletions Excel.Labs.NET5Demo/Excel.Labs.NET5Demo.csproj
Original file line number Diff line number Diff line change
@@ -1,26 +1,26 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFramework>net5.0</TargetFramework>
<Version>2.2.1</Version>
<FileVersion>2.2.1</FileVersion>
<AssemblyVersion>2.2.1</AssemblyVersion>
<Authors>Doxa Labs Ltd</Authors>
<Company>Doxa Labs Ltd</Company>
<Product>Doxa Lab's Excel Tools</Product>
<Description>This tool provides a C# based solution to create Excel files Simple and Fast. This package supports Android, iOS, Linux, macOS and Windows.</Description>
<Copyright>© 2019-2023 Doxa Labs Ltd. All Rights Reserved.</Copyright>
<PackageLicenseExpression>MIT</PackageLicenseExpression>
<PackageProjectUrl>https://doxalabs.co.uk</PackageProjectUrl>
<RepositoryUrl>https://github.com/doxa-labs/ExcelLabs.git</RepositoryUrl>
<RepositoryType>git</RepositoryType>
<PackageTags>Excel Office xls xlsx IO C# OpenXml Dataset .NETStandard</PackageTags>
<PackageReleaseNotes>.NET 6 &amp; .NET Framework Demo</PackageReleaseNotes>
</PropertyGroup>
<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFramework>net5.0</TargetFramework>
<Version>3.0.3</Version>
<FileVersion>3.0.3</FileVersion>
<AssemblyVersion>3.0.3</AssemblyVersion>
<Authors>Doxa Labs Ltd</Authors>
<Company>Doxa Labs Ltd</Company>
<Product>Doxa Lab's Excel Tools</Product>
<Description>This tool provides a C# based solution to create Excel files Simple and Fast. This package supports Android, iOS, Linux, macOS and Windows.</Description>
<Copyright>© 2019-2024 Doxa Labs Ltd. All Rights Reserved.</Copyright>
<PackageLicenseExpression>MIT</PackageLicenseExpression>
<PackageProjectUrl>https://doxalabs.co.uk</PackageProjectUrl>
<RepositoryUrl>https://github.com/doxa-labs/ExcelLabs.git</RepositoryUrl>
<RepositoryType>git</RepositoryType>
<PackageTags>Excel Office xls xlsx IO C# OpenXml Dataset .NETStandard</PackageTags>
<PackageReleaseNotes>.NET 8 Demo and OpenXml v3.0.3</PackageReleaseNotes>
</PropertyGroup>

<ItemGroup>
<ProjectReference Include="..\Excel.Labs\Excel.Labs.csproj" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\Excel.Labs\Excel.Labs.csproj" />
</ItemGroup>

</Project>
25 changes: 24 additions & 1 deletion Excel.Labs.NET5Demo/Program.cs
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
using System;
using System.Collections.Generic;
using System.IO;

// team
using Doxa.Labs.Excel.Models;

Expand All @@ -17,6 +19,11 @@ static void Main(string[] args)
// TODO: full path: C:\Users\...\ExcelLabs\Excel.Labs.NET5Demo\bin\Debug\net6.0\Files
string path = AppDomain.CurrentDomain.BaseDirectory + @"Files\";

if (!Directory.Exists(path))
{
Directory.CreateDirectory(path);
}

// 1. create a cell list
List<Cellx> cells = new();

Expand All @@ -36,7 +43,8 @@ static void Main(string[] args)
"", // K
"Objective-C", // L
"C++", // M
"F#" // N
"F#", // N
"2024 June" // O
};

foreach (string lang in languages)
Expand All @@ -59,6 +67,21 @@ static void Main(string[] args)
// call save function
ExcelLabs.SaveFile(title, path, sheetName, cells);

// call safe save function
ExcelLabs.SaveFileWithCleanXmlText(title, path, sheetName, cells);

// clean not-allowed XML characters
string safeToWriteText = ExcelLabs.CleanTextForXml(title + " safe");
Console.WriteLine("Safe text: " + safeToWriteText);

// convert integer to Excel Column Letter like 1 to A
string excelColumnLetter1 = ExcelLabs.ColumnIndexToColumnLetter(1);
Console.WriteLine("1 to column letter: " + excelColumnLetter1); // A

// convert integer to Excel Column Letter like 1 to G
string excelColumnLetter7 = ExcelLabs.ColumnIndexToColumnLetter(7);
Console.WriteLine("7 to column letter: " + excelColumnLetter7); // G

Console.WriteLine("Done. Check the path now to see the Excel file.");
Console.ReadLine();
}
Expand Down
45 changes: 23 additions & 22 deletions Excel.Labs.NET6Demo/Excel.Labs.NET6Demo.csproj
Original file line number Diff line number Diff line change
@@ -1,27 +1,28 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFramework>net6.0</TargetFramework>
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>
<Version>2.2.1</Version>
<FileVersion>2.2.1</FileVersion>
<AssemblyVersion>2.2.1</AssemblyVersion>
<Authors>Doxa Labs Ltd</Authors>
<Company>Doxa Labs Ltd</Company>
<Product>Doxa Lab's Excel Tools</Product>
<Description>This tool provides a C# based solution to create Excel files Simple and Fast. This package supports Android, iOS, Linux, macOS and Windows.</Description>
<Copyright>© 2019-2023 Doxa Labs Ltd. All Rights Reserved.</Copyright>
<PackageLicenseExpression>MIT</PackageLicenseExpression>
<PackageProjectUrl>https://doxalabs.co.uk</PackageProjectUrl>
<RepositoryUrl>https://github.com/doxa-labs/ExcelLabs.git</RepositoryUrl>
<RepositoryType>git</RepositoryType>
<PackageTags>Excel Office xls xlsx IO C# OpenXml Dataset .NETStandard</PackageTags>
</PropertyGroup>
<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFramework>net6.0</TargetFramework>
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>
<Version>3.0.3</Version>
<FileVersion>3.0.3</FileVersion>
<AssemblyVersion>3.0.3</AssemblyVersion>
<Authors>Doxa Labs Ltd</Authors>
<Company>Doxa Labs Ltd</Company>
<Product>Doxa Lab's Excel Tools</Product>
<Description>This tool provides a C# based solution to create Excel files Simple and Fast. This package supports Android, iOS, Linux, macOS and Windows.</Description>
<Copyright>© 2019-2024 Doxa Labs Ltd. All Rights Reserved.</Copyright>
<PackageLicenseExpression>MIT</PackageLicenseExpression>
<PackageProjectUrl>https://doxalabs.co.uk</PackageProjectUrl>
<RepositoryUrl>https://github.com/doxa-labs/ExcelLabs.git</RepositoryUrl>
<RepositoryType>git</RepositoryType>
<PackageTags>Excel Office xls xlsx IO C# OpenXml Dataset .NETStandard</PackageTags>
<PackageReleaseNotes>.NET 8 Demo and OpenXml v3.0.3</PackageReleaseNotes>
</PropertyGroup>

<ItemGroup>
<ProjectReference Include="..\Excel.Labs\Excel.Labs.csproj" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\Excel.Labs\Excel.Labs.csproj" />
</ItemGroup>

</Project>
25 changes: 23 additions & 2 deletions Excel.Labs.NET6Demo/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,14 @@

// TODO: create a folder named Files to run this demo
// TODO: or, you may change the path
// TODO: full path: C:\Users\...\ExcelLabs\Excel.Labs.NET5Demo\bin\Debug\net6.0\Files
// TODO: full path: C:\Users\...\ExcelLabs\Excel.Labs.NET6Demo\bin\Debug\net6.0\Files
string path = AppDomain.CurrentDomain.BaseDirectory + @"Files\";

if (!Directory.Exists(path))
{
Directory.CreateDirectory(path);
}

// 1. create a cell list
List<Cellx> cells = new();

Expand All @@ -32,7 +37,8 @@
"", // K
"Objective-C", // L
"C++", // M
"F#" // N
"F#", // N
"2024 June" // O
};

foreach (string lang in languages)
Expand All @@ -55,5 +61,20 @@
// call save function
ExcelLabs.SaveFile(title, path, sheetName, cells);

// call safe save function
ExcelLabs.SaveFileWithCleanXmlText(title, path, sheetName, cells);

// clean not-allowed XML characters
string safeToWriteText = ExcelLabs.CleanTextForXml(title + " safe");
Console.WriteLine("Safe text: " + safeToWriteText);

// convert integer to Excel Column Letter like 1 to A
string excelColumnLetter1 = ExcelLabs.ColumnIndexToColumnLetter(1);
Console.WriteLine("1 to column letter: " + excelColumnLetter1); // A

// convert integer to Excel Column Letter like 1 to G
string excelColumnLetter7 = ExcelLabs.ColumnIndexToColumnLetter(7);
Console.WriteLine("7 to column letter: " + excelColumnLetter7); // G

Console.WriteLine("Done. Check the path now to see the Excel file.");
Console.ReadLine();
45 changes: 23 additions & 22 deletions Excel.Labs.NET7Demo/Excel.Labs.NET7Demo.csproj
Original file line number Diff line number Diff line change
@@ -1,27 +1,28 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFramework>net7.0</TargetFramework>
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>
<Version>2.2.1</Version>
<FileVersion>2.2.1</FileVersion>
<AssemblyVersion>2.2.1</AssemblyVersion>
<Authors>Doxa Labs Ltd</Authors>
<Company>Doxa Labs Ltd</Company>
<Product>Doxa Lab's Excel Tools</Product>
<Description>This tool provides a C# based solution to create Excel files Simple and Fast. This package supports Android, iOS, Linux, macOS and Windows.</Description>
<Copyright>© 2019-2023 Doxa Labs Ltd. All Rights Reserved.</Copyright>
<PackageLicenseExpression>MIT</PackageLicenseExpression>
<PackageProjectUrl>https://doxalabs.co.uk</PackageProjectUrl>
<RepositoryUrl>https://github.com/doxa-labs/ExcelLabs.git</RepositoryUrl>
<RepositoryType>git</RepositoryType>
<PackageTags>Excel Office xls xlsx IO C# OpenXml Dataset .NETStandard</PackageTags>
</PropertyGroup>
<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFramework>net7.0</TargetFramework>
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>
<Version>3.0.3</Version>
<FileVersion>3.0.3</FileVersion>
<AssemblyVersion>3.0.3</AssemblyVersion>
<Authors>Doxa Labs Ltd</Authors>
<Company>Doxa Labs Ltd</Company>
<Product>Doxa Lab's Excel Tools</Product>
<Description>This tool provides a C# based solution to create Excel files Simple and Fast. This package supports Android, iOS, Linux, macOS and Windows.</Description>
<Copyright>© 2019-2024 Doxa Labs Ltd. All Rights Reserved.</Copyright>
<PackageLicenseExpression>MIT</PackageLicenseExpression>
<PackageProjectUrl>https://doxalabs.co.uk</PackageProjectUrl>
<RepositoryUrl>https://github.com/doxa-labs/ExcelLabs.git</RepositoryUrl>
<RepositoryType>git</RepositoryType>
<PackageTags>Excel Office xls xlsx IO C# OpenXml Dataset .NETStandard</PackageTags>
<PackageReleaseNotes>.NET 8 Demo and OpenXml v3.0.3</PackageReleaseNotes>
</PropertyGroup>

<ItemGroup>
<ProjectReference Include="..\Excel.Labs\Excel.Labs.csproj" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\Excel.Labs\Excel.Labs.csproj" />
</ItemGroup>

</Project>
25 changes: 23 additions & 2 deletions Excel.Labs.NET7Demo/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,14 @@

// TODO: create a folder named Files to run this demo
// TODO: or, you may change the path
// TODO: full path: C:\Users\...\ExcelLabs\Excel.Labs.NET5Demo\bin\Debug\net6.0\Files
// TODO: full path: C:\Users\...\ExcelLabs\Excel.Labs.NET7Demo\bin\Debug\net7.0\Files
string path = AppDomain.CurrentDomain.BaseDirectory + @"Files\";

if (!Directory.Exists(path))
{
Directory.CreateDirectory(path);
}

// 1. create a cell list
List<Cellx> cells = new();

Expand All @@ -32,7 +37,8 @@
"", // K
"Objective-C", // L
"C++", // M
"F#" // N
"F#", // N
"2024 June" // O
};

foreach (string lang in languages)
Expand All @@ -55,5 +61,20 @@
// call save function
ExcelLabs.SaveFile(title, path, sheetName, cells);

// call safe save function
ExcelLabs.SaveFileWithCleanXmlText(title, path, sheetName, cells);

// clean not-allowed XML characters
string safeToWriteText = ExcelLabs.CleanTextForXml(title + " safe");
Console.WriteLine("Safe text: " + safeToWriteText);

// convert integer to Excel Column Letter like 1 to A
string excelColumnLetter1 = ExcelLabs.ColumnIndexToColumnLetter(1);
Console.WriteLine("1 to column letter: " + excelColumnLetter1); // A

// convert integer to Excel Column Letter like 1 to G
string excelColumnLetter7 = ExcelLabs.ColumnIndexToColumnLetter(7);
Console.WriteLine("7 to column letter: " + excelColumnLetter7); // G

Console.WriteLine("Done. Check the path now to see the Excel file.");
Console.ReadLine();
28 changes: 28 additions & 0 deletions Excel.Labs.NET8Demo/Excel.Labs.NET8Demo.csproj
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFramework>net8.0</TargetFramework>
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>
<Version>3.0.3</Version>
<FileVersion>3.0.3</FileVersion>
<AssemblyVersion>3.0.3</AssemblyVersion>
<Authors>Doxa Labs Ltd</Authors>
<Company>Doxa Labs Ltd</Company>
<Product>Doxa Lab's Excel Tools</Product>
<Description>This tool provides a C# based solution to create Excel files Simple and Fast. This package supports Android, iOS, Linux, macOS and Windows.</Description>
<Copyright>© 2019-2024 Doxa Labs Ltd. All Rights Reserved.</Copyright>
<PackageLicenseExpression>MIT</PackageLicenseExpression>
<PackageProjectUrl>https://doxalabs.co.uk</PackageProjectUrl>
<RepositoryUrl>https://github.com/doxa-labs/ExcelLabs.git</RepositoryUrl>
<RepositoryType>git</RepositoryType>
<PackageTags>Excel Office xls xlsx IO C# OpenXml Dataset .NETStandard</PackageTags>
<PackageReleaseNotes>.NET 8 Demo and OpenXml v3.0.3</PackageReleaseNotes>
</PropertyGroup>

<ItemGroup>
<ProjectReference Include="..\Excel.Labs\Excel.Labs.csproj" />
</ItemGroup>

</Project>
Loading

0 comments on commit 9a493bd

Please sign in to comment.