Available Now: Explore our latest release with enhanced accessibility and powerful IDP features
By Roger Dunham | 2024 Jul 11
4 min
Tags
fluent
apryse fluent
document generation
template
Summary: Fluent by Apryse simplifies dynamic document creation. Design templates in familiar Microsoft Office, then effortlessly integrate data from various sources. This article explores how changes in templates, data, and output formats affect the generated document. A key benefit: modify data and sources without altering the template, boosting efficiency.
Creating dynamic and personalized documents and reports is critical for modern, digitally driven businesses across many industries. Fluent from Apryse offers a way to simplify this process.
Fluent allows templates to be generated in a familiar Microsoft Office environment and then used to create sophisticated documents effortlessly using the latest available data from a huge range of data sources.
Previous articles have described document generation using the standalone .NET and Java engines, and via the RESTful API.
In this article, we will briefly look at how changes in the template, the data, and the generated document file type affect the format and content of what is generated.
Before we go further, let’s have a quick review of the Dynamic Document Generation Process. There are three steps to generating a document:
Step 1: Set up the template look and feel.
Step 2: Bind data - map data fields to the appropriate placeholders in the template. This enables data to be automatically populated data during document generation.
Step 3: Generate the document. The Fluent engine dynamically replaces placeholders with the provided data, resulting in personalized and accurate documents. The output can be seamlessly generated in a wide range of formats, such as DOCX, PDF, HTML, and many others.
In this article, we won’t look at how to actually run document generation, as that has been covered elsewhere. Instead, we will just see the effect that changes in data or template have on the output.
The data that we will use is from the Client for .NET Core sample that can be found either at GitHub, or as a zip file.
The files that we will use are:
If we run this through the Fluent Engine, then this creates a document that looks something like this below with images, text and tabular data.
Figure 1 – Part of the generated Document based on the default data.
That was easy! A well-formatted report has been generated from a template and data.
To see how powerful this is, let’s look at just one part of the report. This illustrates data for several consecutive months.
Figure 2 - Part of the report demonstrating how negative numbers are displayed.
Currently the value for Actual New Business in January is shown as $45,000. Let’s see what would have been the result if the data had been different. Open the file Manufacturing.xml and update the data for the Actual New Business in January to $52000, instead of $45000, and the associated variance from $5000 to $2000, then save the file.
Figure 3 - Data being modified in the source data document.
Now run the program again, which will cause the document to be regenerated. The output will now show the new and up-to-date information.
Figure 4 - The modified data in the generated document.
This emphasizes that the generated document is based on data, not on hard coded text. Fluent will always use the most up-to-date values that were available at the time of report generation, whatever the source of that data is. In this example, the data came from an XML file, but exactly the same result if the data had come from any other data source.
Did you notice how the changes were obvious in this example, because the table shows positive numbers in black and negative in red and between parentheses? That is a common way of showing financial data, but Word does not support this functionality directly.
Fluent has made Word even better than it already was! It has been able to do this since the format for data is specified in the template.
Let’s see how easy this is.
For this part of the process, you will need the Fluent Word Add-ins installed. Instructions for how to do this are available here.
Once that has been done, open up the template file manufacturing.docx in Word.
Click on the New Business, Variance cell. This shows a message about the type of data that is in the cell, which provides a quick look at the data type, source and formatting.
Figure 5 - A view of the information for a field in the template document.
Next click the Fluent option in the toolbar, then on the Out Tag properties for the NB Variance tag.
This will open a dialog where you can enter the format that you require, either manually, or from a list of options.
Figure 6 - Updating the format for a data field.
Let’s change the format of the cell so that Negative numbers show a negative sign, have no $ symbol, have two decimal places and be black. You can do this just using the dropdown menus, or by manually entering the format code.
Press Apply and close the document, then run the sample code again.
Now we can see that in the document, the way that negative values are shown has changed, even though the data is the same.
Figure 7 - The report with the updated formatting. Negative values are now shown in black.
Fluent Designer gives you the ability to make changes to templates in the familiar environment of Word, and then quickly regenerate reports. Furthermore, the level of skill needed to change the layout of the template is around the same as that needed to use formatting in Word, so many users will be able to do so, rather than needing a software developer to change code somewhere in some obscure file.
Before we move on, we will put the formatting back to the way that it was for negative numbers. If you are using the Fluent Manager then that is a breeze, since each time a template is updated, a new version is created, and you can swap between them. If not, then you will need to re-open the Fluent designer for the NB Variance Out tag.
So far, we have seen how we can create a report as a Word document, and seen how to change formatting, and how changes in the data are reflected in the report.
The Fluent engine, however, supports more than just Word. Other options include .pdf, .rtf, .html, .xlsx and .pptx.
Changing the output type is a breeze. For example, if the you change the file extension for the output document from .docx to .pdf file then a PDF will be generated. No other work is required.
Figure 8 - The Report generated as a PDF, simply by changing the specified output file extension.
There are some limitations on what template types can be used to create specific output types. If you need help, check out the supporting documentation here.
The Fluent report generation system allows high quality reports to be created from a range of data sources, using a template generation system that is familiar, and a range of Fluent engine hosting options. We have seen how easy it is to get it running, and how changes in data, templates and output document types can influence the generated report.
You will quickly realize how much time this will save and will want to know more.
There is some great documentation to help you get started quickly. There is also a channel on Discord if you have any issues.
Tags
fluent
apryse fluent
document generation
template
Roger Dunham
Share this post
PRODUCTS
Enterprise
Small Business
Popular Content