As mentioned in my previous post, the full functionality of Rich Text Content Controls (RTCC) is now available with Wordlayout+. In standard Wordlayout, RTCC could also be used, in fact, but more or less only in the same way as plain text content controls. RTCC offer almost unlimited possibilities, because the content of a RTCC can be rather anything (except other RTCC), for example text lines, pictures, tables and whole Word documents. Indeed, the content of an RTCC is stored as a small Word document in Flat Open XML format (see for example https://blogs.msdn.microsoft.com/ericwhite/2008/09/29/the-flat-opc-format/)
I will give you now an exciting example, about the possibilities of RTCC with Wordlayout+…… Consider the following Word document:
This has been created with a sample NAV report together with Wordlayout+. The layout of the report is not too complex:
In fact, it consists of a repeater around a single table row. In the first column of the table is a plain text control bound to text variable hl1 and with property “Allow multiple paragraphs” set to true for manual line breaks. In the second column is a RTCC bound to the text variable hl2.
And here is the report design:
The Integer DataItem is filtered to Number=FILTER(1..5) to show five lines of output.
And here is the code of the report:
For the manual line break in the first column’s plain text control, the crlf variable has been defined. The line break of the RTCC is accomplished with a function called from Codeunit WLMgt – Wordlayout Mgt.
The sample report together with the codeunit (NAV 2016) can be downloaded here:
Note, that you need Wordlayout+ to run the report with the expected result. Wordlayout+ can be downloaded from the previous blog post.
The main advantage of the RTCC is the dynamic space usage. An image content control, for example, always consumes the same space, regardless of it is showing a picture or not. In Wordlayout+ it is shown as an empyt 1 pixel white picture in that case.
Another advantage is, that you can use formatted text (bold, italic) and you can easily implement further features into Codeunit Wordlayout Mgt. to suit your needs.