-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathProgram.cs
More file actions
63 lines (59 loc) · 2.53 KB
/
Program.cs
File metadata and controls
63 lines (59 loc) · 2.53 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
using System;
using PdfReportFromDatabase.Examples;
namespace PdfReportFromDatabase
{
class Program
{
static void Main(string[] args)
{
string fileName = string.Empty;
bool exit = false;
Console.WriteLine("This example shows options for handling bookmarks when merging PDFs together using DynamicPDF Merger for .NET");
Console.WriteLine();
while (!exit)
{
Console.WriteLine(" A : Simple Report with 1 Query (SimpleReportExample)");
Console.WriteLine(" B : Report with a Sub Report (ReportWithSubReportExample)");
Console.WriteLine(" C : Multiple reports in the same document (MultipleReportsExample)");
Console.WriteLine();
Console.Write("Please press the corresponding key to run an example. Press any other key to quit: ");
ConsoleKeyInfo runKey = Console.ReadKey();
Console.WriteLine();
Console.WriteLine();
switch (runKey.KeyChar)
{
case 'a': goto case 'A';
case 'A':
fileName = "SimpleReportExample.pdf";
SimpleReportExample.Run(fileName);
break;
case 'b': goto case 'B';
case 'B':
fileName = "ReportWithSubReportExample.pdf";
ReportWithSubReportExample.Run(fileName);
break;
case 'c': goto case 'C';
case 'C':
fileName = "MultipleReportsExample.pdf";
MultipleReportsExample.Run(fileName);
break;
default:
exit = true;
break;
}
if (!exit)
{
Console.WriteLine("Press 'A' to open the PDF. Press any other key to continue.");
ConsoleKeyInfo openKey = Console.ReadKey(true);
Console.WriteLine();
if (openKey.KeyChar == 'a' || openKey.KeyChar == 'A')
{
System.Diagnostics.Process.Start(fileName);
Console.WriteLine("Please be sure to close the PDF before running the example again, or an error will occur.");
Console.WriteLine();
}
}
}
}
}
}