Data fields allow you to insert data from different data sources into your document templates. Instead of entering values manually, you place data fields in your template and dox42 uses them to populate the generated document.
Data fields can contain information such as names, addresses, prices or dates.
You can insert them into templates using the dox42 Data Fields explorer.
You can position and format them using the familiar Microsoft Office features.
There are two types of data fields:
Data fields from a data source
Regular data fields provide values from a connected data source, such as an Excel file, a SharePoint list or a database.
For example, you can insert a data field into a document template. When the document is generated, dox42 retrieves the corresponding values from the data source.
No coding required
You do not need to write code to use regular data fields.
Dynamic fields
Dynamic fields allow you to calculate, combine or transform values using Visual Basic for .NET (VB.NET) code. Unlike regular data fields, their values are not retrieved directly from a data source.
Typical use cases include:
Combining values: Combine a first name and a last name into a full name.
Performing calculations: Calculate a total based on a quantity and a unit price.
Modifying text: Replace characters or shorten text to a specified length.
Converting data types: Convert text values into numeric values for further processing.
Processing multiple values: Process collections of values, for example, to calculate a sum.
Calculating date-based values: Determine values based on the current date, such as the week of the year.
Dynamic fields are created for an existing data source in the dox42 Data Map Designer.
Once created, they appear alongside regular data fields in the dox42 Data Fields explorer and can be inserted into templates in the same way.
Coding required
Creating dynamic fields requires knowledge of VB.NET (Visual Basic for .NET), which differs from VBA used in Microsoft Office macros.
dox42 supports only basic VB.NET functions provided by
System.dll, a standard .NET library.For security reasons, access to the file system and environment is blocked.