iExportEngine
iExportEngine copied to clipboard
iTin Export Engine (ITEE). Is a standalone engine for data export of XML, DataSets, typed ArrayList, DataRow array inputs by native/custom writers to MS Excel, Comma-Separated Values (csv), Tab-Separa...
What is iExportEngine?
iTin Export Engine (ITEE) is a standalone engine for data export that allows developers use a modular system based in Managed Extensibility Framework (MEF).
You can export easily data from XML, DataSets, typed ArrayList, DataRow array inputs by native/custom writers to MSExcel, Comma-Separated Values (csv), Tab-Separated Values (txt), SQL Script (sql), XML Spreadsheet 2003 (xml), Portable Document Format (pdf), MS Excel (xlsx), MS Word (docx), using an XML configuration file.
Install via NuGet
- From nuget gallery
|
|
|
|
|
|
|
|
- From package manager console
PM> Install-Package iTin.Export.Core
PM> Install-Package iTin.Export.Writers.Adobe
PM> Install-Package iTin.Export.Writers.OpenXml.Xlsx
PM> Install-Package iTin.Export.Writers.OpenXml.DocX
Samples Project (iTinExportEngineSamples)
Writers samples
1. Comma-Separated Values [ csv ]
Using the native writer CsvWriter, allows you to create .csv files.
Sample1
Creates a simple inventory list.
-
Text View
-
MS Excel View
2. Markdown [ md ]
Currently the development is in progress..., a small example of fully functional use is shown.
Using the native writer MarkdownWriter, allows you to create .md files.
Sample1
Creates a simple inventory list.
Sample2
Creates a large customer list.
3. MS Excel [ xlsx ]
Using the writer XlsxTabularWriter, this writer requires iTin.Export.Writers.OpenXml.Xlsx. Allow you to create .xlsx files.
- EPPlus
Sample1
Simply Creates A New Workbook From Scratch. The Workbook Contains One Worksheet With A Simple Invertory List.
Sample1 (From code)
Same as Sample1 but by code.
Sample2
Equals Sample1 and a Piechart.
Sample3
Use Stacked Charts.
Sample4
Use charts with more than one chart type and secondary axis.
Sample5
Use Pivot Tables (comming soon...)
Sample6
Use Mini Charts.
Sample7
Creates a new workbook from custom enumerated data type (5000 rows).
Sample8
Create a spreadsheet but where only the headers are shown.
Sample9
Create a spreadsheet where the value of a field is not displayed.
- ExportEngine
Sample1
Equals to EPPlus sample1 with an image banner with effects and custom data table location.
Sample2
How to use group fields, Creates a new customer field.
Sample3
How to creates a column header fields.
Sample4
Sample with groups, headers, banner and aggregate's functions.
Sample5
How to use simple filters.
Sample6
How to use conditions.
Sample7
How to add block lines.
Sample8
How to use gap field type.
Sample9
How to use fixed width field type.
Sample10
How to use binded functions.
Sample11
Custom output filename.
Sample12
Custom output filename from binding.
Sample13
How to change the width of the fields.
4. MS Word [ docx ]
Currently the development is in progress..., a small example of fully functional use is shown.
Using the writer DocxTabularWriter, this writer requires iTin.Export.Writers.OpenXml.Docx. Allow you to create .docx files.
Sample1
Equals to EPPlus sample1
5. Portable Document Format [ pdf ]
Currently the development is in progress..., a small example of fully functional use is shown.
Using the writer PdfTabularWriter, this writer requires iTin.Export.Writers.Adobe. Allow you to create .pdf files.
Sample1
Equals to EPPlus sample1
6. SQL Script [ sql ]
Currently the development is in progress..., a small example of fully functional use is shown.
Using the native writer SqlScriptWriter, allows you to create .sql files.
Sample1
Equals to EPPlus sample1
7. Tab-Separated Values [ txt ]
Using the native writer TsvWriter, allows you to create .txt files.
Sample1
Equals to CSV sample1
-
Text View
-
MS Excel View
8. XML Spreadsheet 2003 [ xml ]
Currently the development is in progress..., a small example of fully functional use is shown.
Using the native writer Spreadsheet2003TabularWriter, allows you to create .xml files.
Sample1
Equals to EPPlus sample1
Template samples
1. DocxTemplateSample01
This sample generates several documents in MS Word format (one for each entry in the reference table) from a .docx document that acts as a template.
Below are the steps to follow:
-
Template (Uses DocxFreeTemplateWriter, a builtin template writer)
Any document in docx format, where each field that we want to appear will be prefixed / suffixed (optional) with the characters we consider appropriate.
Input template
-
Data input (For simplicity an xml file has been used as input)
<?xml version="1.0" encoding="utf-8"?>
<ARD740>
<R740D01 PERCENT="23.62" CMCUST="0028539" CMNAME="FIBER CORPORATION " CMADR1="34570 RANDOM DRIVE " CMCITY="NEW LONDON " CMZIP="28127 " />
<R740D01 PERCENT="22.10" CMCUST="0322292" CMNAME="FIBERLOCK TECH " CMADR1="150 DASCOMB ROAD " CMCITY="ANDOVER " CMZIP="01810 " />
<R740D01 PERCENT="23.67" CMCUST="-0206947" CMNAME="FIBERTAK "INC " CMADR1="1180 N MT SPRINGS PKWY " CMCITY="SPRINGVILLE " CMZIP="84663 " />
<R740D01 PERCENT="10.0" CMCUST="0209192" CMNAME="FIDELITY CONTAINER " CMADR1="4039 ROCK QUARRY RD #400 " CMCITY="DALLAS " CMZIP="75211 " />
<R740D01 PERCENT="10.0" CMCUST="0035841" CMNAME="CONTAINER " CMADR1="240 MAIN STREET " CMCITY="MARSEILLES " CMZIP="61341 " />
<R740D01 PERCENT="10.0" CMCUST="0034802" CMNAME="FIELDALE " CMADR1="5282 GAINESVILLE HIGHWAY " CMCITY="BALDWIN " CMZIP="30511 " />
<R740D01 PERCENT="10.0" CMCUST="0028839" CMNAME="FIESTA WAREHOUSE & DIST." CMADR1="5050 STOUT DRIVE " CMCITY="SAN ANTONIO " CMZIP="78219 " />
<R740D01 PERCENT="10.0" CMCUST="0033511" CMNAME="FILM SALVAGE " CMADR1="3575 NORTH HIGHWAY 91 " CMCITY="MOUNTAIN CITY " CMZIP="37683 " />
<R740D01 PERCENT="10.0" CMCUST="zzz0916610" CMNAME="FILMTECH INCORP. " CMADR1="581 MCDONALD AVENUE " CMCITY="BROOKLYN " CMZIP="11218 " />
<R740D01 PERCENT="10.0" CMCUST="0369019" CMNAME="FINA OIL & CHEMICAL CO " CMADR1="2970 PARROTT AVE " CMCITY="ATLANTA " CMZIP="30318 " />
</ARD740>
-
Configuration file
The configuration file we should highlight the following elements/properties when working with templates.
Element Decription Template Root node File Define the file that acts as a template Writer Determines which writer will be used to generate the output (I remind you that these writer can creates it to suit their own needs) Settings Defines the prefix and suffix characters, as well as additional context properties
<?xml version="1.0" encoding="utf-8"?>
<Exports xmlns="http://schemas.itin.com/export/engine/2014/configuration/v1.0">
<Global.Resources>
<Hosts>
<Host Key="docx"/>
</Hosts>
</Global.Resources>
<Export Name="Sample01" Current="Yes">
<Description>Generate docx files from word template file</Description>
<Table Host="docx"
Name="R740D01"
Alias="Template Sample Export">
<Exporter>
<Template>
<File>~\resources\input\template\DocxSampleTemplate.docx</File>
<Writer Name="DocxFreeTemplateWriter">
<Settings FieldPrefix="@@" TrimFields="Yes"/>
</Writer>
</Template>
</Exporter>
<Output>
<Path>~\output\template\docx\</Path>
<File>sample01-from-template-file</File>
</Output>
</Table>
</Export>
</Exports>
- Code
...
...
var inputDataFile = new Uri(Settings.Default.PacketXmlInput, UriKind.Relative);
var input = new XmlInput(inputDataFile);
var configuration = new Uri(Settings.Default.DocxTemplateSample01Configuration, UriKind.Relative);
input.Export(ExportSettings.ImportFrom(configuration));
...
...
-
Output
In the folder specified in the configuration file, as many files as entry elements will be created. The name of each created file will be the same as the one indicated in the configuration file plus a sequential number that starts at 0.
Output folder
First output file (sample01-from-template-file0.docx)
Last output file (sample01-from-template-file9.docx))
How can I send feedback!!!
If you have found iExportEngine useful at work or in a personal project, I would love to hear about it. If you have decided not to use iExportEngine, please send me and email stating why this is so. I will use this feedback to improve iExportEngine in future releases.
My email address is