Create Dynamic Reports from ODT or DOCX
During the last years the “Big Players” for office software developed open document standards basing on XML: The OASIS format for OpenOffice / LibreOffice and the Office Open XML format for Microsoft Office. There are also a set of SDK’s to build those formats from scratch or to manipulate them, some of them with very sophisticated features and a corresponding learning curve (look at the Microsoft SDK for the Office Open XML).
The DotNetOdf library focuses mainly on easy usage. You should be able to create reports with lists or serial letters from templates with just a few lines of code. The library can use dictionaries or exported LazyObjects from the NotReallyORM framework to read the data for the reports. The user should be able to build templates without the help of a programmer. Some experience in using OpenOffice / LibreOffice or MS Office is enough. Important for business users: At runtime you do not need OpenOffice / LibreOffice or MS Office to create the documents (so you also won’t need a license for them).
Some years ago I published a Python library named PyOpenOffice that did the same for the old OpenOffice SXW format (and much more, even PDF generation…). The DotNetOdf library is written in C# and requires a .NET framework version 3.5 (or higher). It has less functionality, but it requires no setup, no entries in your Windows Registry and it integrates seamlessly into your C# or VB.NET projects. It supports not only the ODF formats, but also the MS Word DOCX.
Thanks go to the developers of the DotNetZip library. DotNetOdf uses it to unpack and repack the document archives.
- Grouping a list into sub-lists
- Insert pictures into a template
- More documentation
The DotNetOdf library is published under the Apache License 2.0.
And the whole project: All downloads contain a Visual Studio 2010 project with the framework and an additional Winforms project to test and comment the functions.
Keep in mind: This is an beta version. Download it, try it, find all the bugs and suggest improvements.