-
Notifications
You must be signed in to change notification settings - Fork 13
Expand file tree
/
Copy pathSample_Main.cs
More file actions
63 lines (53 loc) · 2.8 KB
/
Sample_Main.cs
File metadata and controls
63 lines (53 loc) · 2.8 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
/*************************************************************************************************
Required Notice: Copyright (C) EPPlus Software AB.
This software is licensed under PolyForm Noncommercial License 1.0.0
and may only be used for noncommercial purposes
https://polyformproject.org/licenses/noncommercial/1.0.0/
A commercial license to use this software can be purchased at https://epplussoftware.com
*************************************************************************************************
Date Author Change
*************************************************************************************************
01/27/2020 EPPlus Software AB Initial release EPPlus 5
*************************************************************************************************/
using System;
using System.IO;
using System.Threading.Tasks;
namespace EPPlusSamples
{
class Sample_Main
{
static async Task Main(string[] args)
{
try
{
//EPPlus 5 and later uses a dual license model. This requires you to specifiy the License you are using to be able to use the library.
//This sample sets the License in the appsettings.json file. An alternative is the commented row below. If you have a commercial license you can also set it using the License.SetCommercial method.
//ExcelPackage.License.SetNonCommercialPersonal("Your Name");
//See https://epplussoftware.com/Developers/LicenseNotSetException for more info.
//Set the output directory to the SampleApp folder where the app is running from.
FileUtil.OutputDir = new DirectoryInfo($"{AppDomain.CurrentDomain.BaseDirectory}SampleApp");
await WorkbookWorksheetAndRangesSamples.RunAsync();
await ImportAndExportSamples.RunAsync();
StylingBasics.Run();
ConditionalFormattingSamples.Run();
await FiltersAndValidation.RunAsync();
await DrawingsChartsAndThemesSample.RunAsync();
FormulaCalculationSample.Run();
await TablesPivotTableAndSlicersSample.RunAsync();
EncryptionProtectionAndVBASample.Run();
ConnectionsAndQueryTableSample.Run();
}
catch (Exception ex)
{
Console.WriteLine("Error: {0}", ex.Message);
}
var prevColor = Console.ForegroundColor;
Console.ForegroundColor = ConsoleColor.Green;
Console.WriteLine($"Generated sample workbooks can be found in {FileUtil.OutputDir.FullName}");
Console.ForegroundColor = prevColor;
Console.WriteLine();
Console.WriteLine("Press the return key to exit...");
Console.ReadKey();
}
}
}