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.
- 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
Using the native writer CsvWriter, allows you to create .csv files.
Creates a simple inventory list.
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.
Creates a simple inventory list.
Creates a large customer list.
Using the writer XlsxTabularWriter, this writer requires iTin.Export.Writers.OpenXml.Xlsx. Allow you to create .xlsx files.
Simply Creates A New Workbook From Scratch. The Workbook Contains One Worksheet With A Simple Invertory List.
Same as Sample1 but by code.
Equals Sample1 and a Piechart.
Use Stacked Charts.
Use charts with more than one chart type and secondary axis.
Use Pivot Tables (comming soon...)
Use Mini Charts.
Creates a new workbook from custom enumerated data type (5000 rows).
Create a spreadsheet but where only the headers are shown.
Create a spreadsheet where the value of a field is not displayed.
Equals to EPPlus sample1 with an image banner with effects and custom data table location.
How to use group fields, Creates a new customer field.
How to creates a column header fields.
Sample with groups, headers, banner and aggregate's functions.
How to use simple filters.
How to use conditions.
How to add block lines.
How to use gap field type.
How to use fixed width field type.
How to use binded functions.
Custom output filename.
Custom output filename from binding.
How to change the width of the fields.
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.
Equals to EPPlus sample1
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.
Equals to EPPlus sample1
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.
Equals to EPPlus sample1
Using the native writer TsvWriter, allows you to create .txt files.
Equals to CSV sample1
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.
Equals to EPPlus sample1
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))
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