Skip to content

Commit

Permalink
Add demo project
Browse files Browse the repository at this point in the history
  • Loading branch information
perevoznyk committed Aug 23, 2018
1 parent cddf984 commit 784f59b
Show file tree
Hide file tree
Showing 4 changed files with 66 additions and 1 deletion.
41 changes: 41 additions & 0 deletions excel-export-demo/Program.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
using Export.XLS;
using System;
using System.Globalization;
using System.IO;

namespace excel_export_demo
{
class Program
{
static void Main(string[] args)
{
ExcelDocument document = new ExcelDocument();
document.UserName = "Perevoznyk";
document.CodePage = CultureInfo.CurrentCulture.TextInfo.ANSICodePage;

document.ColumnWidth(0, 120);
document.ColumnWidth(1, 80);

document[0, 0].Value = "ExcelWriter Demo";
document[0, 0].Font = new Font("Tahoma", 10, FontStyle.Bold);
document[0, 0].ForeColor = ExcelColor.DarkRed;
document[0, 0].Alignment = Alignment.Centered;
document[0, 0].BackColor = ExcelColor.Silver;

document.WriteCell(1, 0, "int");
document.WriteCell(1, 1, 10);

document.Cell(2, 0).Value = "double";
document.Cell(2, 1).Value = 1.5;

document.Cell(3, 0).Value = "date";
document.Cell(3, 1).Value = DateTime.Now;
document.Cell(3, 1).Format = @"dd/mm/yyyy";

FileStream stream = new FileStream("demo.xls", FileMode.Create);

document.Save(stream);
stream.Close();
}
}
}
13 changes: 13 additions & 0 deletions excel-export-demo/excel-export-demo.csproj
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFramework>netcoreapp2.1</TargetFramework>
<RootNamespace>excel_export_demo</RootNamespace>
</PropertyGroup>

<ItemGroup>
<ProjectReference Include="..\excel-export\excel-export.csproj" />
</ItemGroup>

</Project>
11 changes: 10 additions & 1 deletion excel-export.sln
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,12 @@ Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio 15
VisualStudioVersion = 15.0.27703.2042
MinimumVisualStudioVersion = 10.0.40219.1
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "excel-export", "excel-export\excel-export.csproj", "{DFFF77DD-0BF3-45FF-890E-965994D5F2CD}"
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "excel-export", "excel-export\excel-export.csproj", "{DFFF77DD-0BF3-45FF-890E-965994D5F2CD}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "excel-export-demo", "excel-export-demo\excel-export-demo.csproj", "{B33FCD5D-5250-4D3A-AF21-B75C87809FAB}"
ProjectSection(ProjectDependencies) = postProject
{DFFF77DD-0BF3-45FF-890E-965994D5F2CD} = {DFFF77DD-0BF3-45FF-890E-965994D5F2CD}
EndProjectSection
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Expand All @@ -15,6 +20,10 @@ Global
{DFFF77DD-0BF3-45FF-890E-965994D5F2CD}.Debug|Any CPU.Build.0 = Debug|Any CPU
{DFFF77DD-0BF3-45FF-890E-965994D5F2CD}.Release|Any CPU.ActiveCfg = Release|Any CPU
{DFFF77DD-0BF3-45FF-890E-965994D5F2CD}.Release|Any CPU.Build.0 = Release|Any CPU
{B33FCD5D-5250-4D3A-AF21-B75C87809FAB}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{B33FCD5D-5250-4D3A-AF21-B75C87809FAB}.Debug|Any CPU.Build.0 = Debug|Any CPU
{B33FCD5D-5250-4D3A-AF21-B75C87809FAB}.Release|Any CPU.ActiveCfg = Release|Any CPU
{B33FCD5D-5250-4D3A-AF21-B75C87809FAB}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
Expand Down
2 changes: 2 additions & 0 deletions excel-export/excel-export.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,8 @@ It creates XLS documents in Microsoft Excel Binary Interchange File Format (BIFF
<PackageProjectUrl>https://github.com/perevoznyk/excel-export</PackageProjectUrl>
<SignAssembly>true</SignAssembly>
<AssemblyOriginatorKeyFile>excel-export-key.snk</AssemblyOriginatorKeyFile>
<RepositoryType>git</RepositoryType>
<Copyright>Serhiy Perevoznyk</Copyright>
</PropertyGroup>

</Project>

0 comments on commit 784f59b

Please sign in to comment.