FAQ/accessing-izendas-export-process.md
... ...
@@ -13,12 +13,13 @@ The export process can be invoked by following the code template provided below.
13 13
##Using FileContentGenerator
14 14
15 15
```csharp
16
+string message = string.Empty;
16 17
string outputPath = Path.GetFullPath(string.Format("{0}\\..\\..\\{1}", Path.GetDirectoryName(System.Reflection.Assembly.GetExecutingAssembly().Location), "exports"));
17 18
if (!Directory.Exists(outputPath))
18 19
Directory.CreateDirectory(outputPath);
19 20
foreach (string fileName in Directory.EnumerateFiles(AdHocSettings.ReportsPath))
20 21
{
21
- reportName = fileName.Substring(fileName.LastIndexOf("\\"), fileName.LastIndexOf(".") - fileName.LastIndexOf("\\"));
22
+ string reportName = fileName.Substring(fileName.LastIndexOf("\\"), fileName.LastIndexOf(".") - fileName.LastIndexOf("\\"));
22 23
FileInfo fi = new FileInfo(fileName);
23 24
ReportSet rs = ReportSet.InitializeNew();
24 25
string reportXml = string.Empty;
... ...
@@ -27,7 +28,8 @@ foreach (string fileName in Directory.EnumerateFiles(AdHocSettings.ReportsPath))
27 28
try
28 29
{
29 30
rs.ReadXml(reportXml);
30
- Izenda.AdHoc.Html2PdfGenerator gen = new Izenda.AdHoc.Html2PdfGenerator();
31
+ rs.ReportName = reportName;
32
+ Izenda.AdHoc.EvoPdfGenerator gen = new Izenda.AdHoc.EvoPdfGenerator();
31 33
Izenda.Controls.FileContentGenerator fileGen = gen.GenerateOutput(rs) as Izenda.Controls.FileContentGenerator;
32 34
File.WriteAllBytes(string.Format("{0}\\{1}.{2}", outputPath, fileGen.OutputFileName, gen.FileExtension), fileGen.Content);
33 35
message = string.Format("File {0}.{1} written to {2}", fileGen.OutputFileName, gen.FileExtension, outputPath);
... ...
@@ -38,15 +40,17 @@ foreach (string fileName in Directory.EnumerateFiles(AdHocSettings.ReportsPath))
38 40
}
39 41
Console.WriteLine(message);
40 42
}
41
-
42 43
```
43 44
44
-There are also other classes that are accessible in the same manner and that inherit from the same interface. Simply replace the Html2PdfGenerator with the necessary class to export to different formats. These classes are defined as follows:
45
+There are also other classes that are accessible in the same manner and that inherit from the same interface. Simply replace the EvoPdfGenerator with the necessary class to export to different formats. These classes are defined as follows:
45 46
46 47
* CsvReportOutputGenerator
47 48
* BulkCsvReportOutputGenerator
48 49
* XmlReportOutputGenerator
49
-* ITextSharpPdfGenerator (The Html2PdfGenerator uses EO)
50 50
* SqlReportOutputGenerator
51
+* ITextSharpPdfGenerator (older PDF generator, not recommended)
52
+* Html2PdfGenerator (for EO PDF)
53
+* PhantomJSPdfGenerator (note that the PhantomJS.exe is required for this output type and must exist in the bin/phantomjs/ folder for web apps and ~/phantomjs folder for non-web apps)
54
+* EvoAzurePdfGenerator (for Azure cloud services)
51 55
52
-These classes exist in the Izenda.AdHoc namespace. FileContentGenerator exist in Izenda.Controls.
... ...
\ No newline at end of file
0
+These classes exist in the Izenda.AdHoc namespace. FileContentGenerator exists in Izenda.Controls.
... ...
\ No newline at end of file