Docentric Toolkit 5.0 released
This release brings new interesting features and improvements.
Visual Formatting
The new version allows you to specify rules for dynamic visual formatting such as text color, text styles, background color, etc. Consider a report that renders a list of products with columns like product name, category, quantity and price:
Let’s say that we need to render all prices that are below 20 in red. In order to do so we can specify a so called Visual Format Override for the Price Field tagging element by specifying the rule for the text color:
As you can see in the screenshot above, a Visual Format Override is defined by three properties:
- Target document object such as Paragraph, Table Row, Cell.
- Format Property of a target object that we want to define a Visual Format Override for.
- Value (Binding) for the format property.
The screenshot below shows visual representation of a tagging element with specified Visual Format Override:
Running the report shows that text of all product rows with prices less than 20 is now rendered in red:
Note that you can specify Visual Format Overrides for all types of tagging elements.
Dynamic Table Columns
The new Visual Format feature will now also allow you to have dynamic table columns. In order to make a table column conditionally shown, you just need to have a tagging element in any table cell of the target column. Then you need to specify a new Visual Format Override and select This Table Column as Target and specify the value (Binding) for the Visibility property.
When the value of the Visual Format Override equals True, the “Category” table column is rendered:
Otherwise the table row will be removed and not shown in the generated document:
MS Word Add-In improvements
This is the first version of Docentric Toolkit that takes advantage of some of the new MS Word features introduced in MS Word 2013.
Tagging elements spanning multiple table rows
List tagging elements are mostly used with table rows to render items in tables. Until now a List tagging element could only wrap a single table row and if your report needed to list items in a table with a two-rows-per-item layout, you needed to employ tricks with nested tables which was quite tedious and cumbersome.
In the new release List and Group elements can now wrap multiple table rows as shown on the screenshot below:
The template above produces the document shown on the next screenshot:
The new Show Tags button
Those of you who have been using the Design Mode button a lot probably know that adding content into tagging elements while Design Mode is on can corrupt a template document. We have replaced the old Design Mode functionality with the new Show Tags button which shows tagging elements as tags just like before but without any unwanted side effects.
Colorized tagging elements
We also took advantage of the new MS Word 2013 feature that allows to specify a different color for each content control in a document. Now each type of a tagging element has its own separate color. This makes complex templates more readable and easier to navigate through.
Image Output
We added the image output format. Now you can save documents into a number of bitmap and vector image files.
1 2 3 4 5 6 7 8 9 10 11 12 |
// Load the document. Document document = Document.Load(@"C:\TestDocument.docx"); // Save the document to EMF images. ImageSaveOptions imageSaveOption = new ImageSaveOptions(ImageFormat.Emf); SaveAsImageResult result = document.SaveAsImage(imageSaveOption); // Do something with the generated images. foreach (var pageImage in result.PageImages) { // Do something with the current image representing a document page. } |
Single Assembly
Previously, you needed to reference multiple references in your .NET projects. In contrast, the new version of Docentric Tookit provides only a single assembly that you need to reference:
Docentric.Documents.dll
In order to upgrade to the new version, you will need to remove all Docentric Toolkit Engine references from the project and add a reference to the assembly Docentric.Documents.dll. There are no breaking changes in APIs, so the projects will compile without any source code changes.
NuGet
Docentric Toolkit Engine is now available as a NuGet package. The package doesn’t install Docentric Toolkit Add-In for MS Word and only contains the report engine. This is why it is recommended to download and install the setup from our website the first time when installing Docentric Toolkit.