fDocs Designer provides users with a way of both adding fields of data (known as Data Tags) to templates, and also conditionally formatting the output document depending on rules or by adding extra instructions to the template.
This is done by adding Special Tags to the template. These tags are shown in green within a template and can be added using the commands available from the fDocs Designer ribbon in Word.
From the ribbon you are also able to upload your template, preview the document, and open the Tag List and Tags In Use panels.
The Special Tags available are as follows:
Condition Tags allow you to highlight a section of your template and only show it depending on a condition being met, for example “Only show this paragraph if the age of the client is under 18”.
To add a Condition Tag to your document, highlight the part of the document you want to be subject to the condition and then click the Condition Tag from the ribbon. The Tag will surround your content and a further tag will be added, called the Condition Function Tag.
Click inside this tag and (when you have the Tag List or Tags In Use panels on display) you will be able to click the Dialogue Button to open the Function Builder and set up the Function that will apply to this part of the document. The Function must evaluate to true in order for the content to be shown.
If you know Functions well, you may type the function into the Condition Function tag directly.
Condition Block Tags allow you to highlight a larger section of your document, which can include many Condition Tags, and only the contents of the first Condition that evaluates to true will be shown. All others will be ignored.
These special tags allow you to highlight a piece of your document (which should include some data Tags), and the whole content will be removed if either the marked block is empty or all the field tags enclosed (but not other text in the document) return an empty (null) or blank value, respectively.
For example, this is useful in cases where you want to remove a line from an address where a district has not been entered, but you can also use it around paragraphs or sentences to stop them being shown where a flag or value has not been filled in.
Charts are an important part of fDocs. It is useful to be able to include the power of charts for Microsoft Word, but have them display data that has been returned from the DSD.
To add a chart to your document, create a chart as normal in Word, and then create a table of data including data tags where appropriate. Then, highlight both the chart and your table, and click the Chart Special Tag button in the ribbon. A new Chart tag will surround your content, and clicking inside it will display the Chart Dialog button within the Tag List / Tags In Use panels.
Opening the Chart Dialog presents some further customisation options:
Here you can specify two ways in which the data should be treated, as opposed to normal column-based substitution.
Checking this option removes the table of data from the document output. Default behaviour is to leave the table of data to be shown when the output document is generated.
When the output document is generated, the table of data that powers your chart will be replaced with data within the table you have placed within the Chart tag.
fDocs is able to include images based on locations calculated in real time, or based from Base-64 data held within fields in a database or returned from an API.
To add an image into your document, add any picture into your Word template as you would do normally. Set the size of the picture as you wish - fDocs will adhere to the height/width ratio of the image you put into your document, but contained within the dimensions of the inserted image.
Then, highlight your image and click the Image button from the Insert group of the Designer ribbon. An image tag will surround your picture and a further tag will be added allowing you to specify the location of the image that should replace the image when the output is generated.
The image location can be a UNC-based file location (such as \\servername\filename.jpg) or Base 64 encoded data. If the Base64 information is held in a field, place its data tag here. You may construct a path using a Function tag here too, for example to join a network path with the name of the client and the extension (such as “.jpg” or “.png”) on the end.
Functions are very powerful and allow you to include a range of calculated data directly into your template. There is a wide range of functions available within fSeries that provide for real-time calculation and reformatting of strings, numbers, dates, and more.
To add a Function to your template, click the Function button in the Designer ribbon. A function tag will be inserted into your document.
If you are familiar with functions, you may type one in directly. Or, to use the Function Builder, click inside the tag and the Function Builder Dialog button will appear in the Tag List / Tags In Use Panels if they are on display. Use the Dialog to construct your function and the result will be placed into the Function Tag.
When the document is generated, the Function will be calculated and the result shown in place of the Function tag in your output.
The Raw Tag allows you to display the raw value of the field, rather than its formatted value. This can be useful in terms of numbers (if you do not want it to be shown with commas), or for dates. To show any field's Raw value, simply highlight the data Tag and click the Raw button in the Designer ribbon. The Raw tag will then surround the field tag.
The HTML tag reformats the value of the field according to HyperText Markup Language. For example, if the value of a field in your database is shown as “<b>Your Name</b>”, then surrounding the field with the HTML tag will display the result as “Your Name”. As per the Raw tag, highlight your data Tag, then click the “HTML” button in the ribbon to surround it with the HTML formatting tag.
The Yes/No tag is used to reformat a block of your template, changing values that you specify to “Yes” and “No” as appropriate. For example, if you had a number of fields that had the value “Y” and “N” in, but you wanted to show them as Yes and No, highlight the part of your template with the relevant fields, and click the Yes/No button on the Designer ribbon.
The Yes/No tag will then surround the content you have highlighted and two further tags will be inserted at the start of your block of text, called “Yes/No Yes” and “Yes/No No”. Into these fields place the content you want to replace any instance of Yes/No values within the block. Values that are checked for are “Yes”,“Y”,“True”,“No”,“N” and “False”.
A further special tag, called “Yes/No Numbers”, specifies that any occurrences of 1 and 0 should also be treated as Yes and No and changed accordingly. This tag can only be added within a Yes/No block.
The Comment Tag allows Template administrators to insert any content they wish and it will be removed when output documents are generated.
This is useful to allow you to make notes, revision information, or record changes directly within the template. You can also paste portions of your template within this tag if you are unsure whether you want to use them in the output, but don't want to get rid of them just yet.
To apply the Comment Tag, simply highlight the portion of the document you want to treat as comments, and then click the Comment Tag button in the ribbon. The Comment Tag will then surround the affected content.
Not so much a Special Tag in its own right, the Detach Tag command allows you to remove a tag without removing the content inside the tag. Usually, to remove a tag you would highlight it in your document and then press the Delete key on your keyboard, but this will clear the content within it.
Highlighting any tag, then clicking Detach Tag in the ribbon, will remove the tag but retain its contents.
The Output Properties command provides a means for changing properties of the generated output at run-time by the end user. There are a number of document properties available, such as Author, Keywords, Company, Title, Version, and many more.
Clicking the Output Properties button opens a dialogue allowing you to specify the values that should be attributed to the document when it is run. Enter any value to set it directly, or use the Function Builder button next to any entry to open the Function Builder dialogue and build a function to be calculated during output generation.